You are on page 1of 11

1.

(a)

(b)

(c)

University of Mumbai TYBSc Computer Science Paper IV March 2012 Solution Set Write short notes (Attempt any Four) Lock Manager Marks Distrib-5 Imp Points: The part of DBMS keeps track of locks issued Maintains a lock table Hash table with data object( page, record etc.) identifier as key. Contains type of lock Maintain transaction table contains a pointer to list of locks held by transaction. According to the 2PL manages lock request for shared lock or exclusive lock. If not possible grant lock add request in queue. Suggestions CASE statement in PL/SQL Marks Distrib-5 Imp Points: Simple Case Search Case Case expr Case When expe-val-1 then When Boolean_expe-val-1 then Statement; ; Statement; ; When expe-val-2 then When Boolena_expe-val-2 then Statement; ; Statement; ; Else Else Statement; ; Statement; ; End case; End case; i.e Declare Tr_code number; Begin . Case Tr_code when 1 then insert . When 2 then Update. Else DBMS_OUTPUT. End case; End; Suggestions Responsibilities of Project Manager Marks Distrib-5 Imp Points: Acts as a controller establishes the team & done following activites: Internal : Identify project tasks & build a work breakdown structure- Develop the project schedule- recruit & train team members- Assign task to membersCoordinate activites of team & subteam members- Monitor & control deliverables & milestones of project- verify qulaity of project External: Reports the status & progress of project. Establish good working

(20)

(d)

relationship with end users Work directly with client- identify resorcess needed & arranges those. Suggestions Phases in Unified Process Marks Distrib-5 Imp Points: Inspection deals with approximate version of system- produce rough estimate Elaborate- refine version-finalize scope, design & implement core activitiesresolve high risks prepare cost estimate & schedule Construction Iteratively implement the remaining lower risk predicates & easier elements- prepare for deployment Translation complete beta test-& deployment so user can have working system Suggestions Stages /phases in static testing Marks Distrib-5 Imp Points: 1. Control flow analysis checks loops with multiple exit or entry points & unreachable code 2. Data use analysis checks Un-initialized variables, variables written twice without an intervening assignment & variables which ar declared but never used. 3. Interface analysis- checks Consistency of routine and procedure declaration & their use 4. Information flow analysis- checks Dependencies of output variables, information for code inspection or review 5. Path analysis checks path through the program & sets out the statements executed in that path. Suggestions Closure set of FD The set of all FDs implied by a given set of F of FDs is called the closure of F, denoted as F+.- to infer closure of FDs following rules (Armstrongs Axioms ) can be applied: Reflexivity if X Y , then XY Augmentation if X Y, then XZYZ for any Z Transitivity if Xy and YZ, then XZ Suggestions Attempt any Four Explain the concept of transaction & schedule with example. Marks Distrib-5 Imp Points: Transaction- a series of actions(Read, Write of database objects) i.e. RT(O) , WT(O) in addition to these actions each transaction must specify final action as commit or abort. Schedule: - list of actions from a set of transactions and order in which two actions of a transaction T appear in a schedule i.e represents execution sequence Ex. T1 T2 R(A) W(A) (20)

(e)

(f)

2. (a)

R(B) W(B) Commit R(C) W(C) A schedule that contains abort or commit for each transaction is called complete Schedule. Suggestions State the structures associated with recovery. Explain any one of them. Marks Distrib-5 2+3 Imp Points: The LOG also called as trail/Journal - History of actions executed by the DBMS. Physically it is file durability can be aceived by maintain more copies on different disks. Log tail(recent portion) kept in memory- every record is given unique id called log sequence number(LSN). pageLSN is used in recovery. log record is written for actions like updating a page, commit, abort, end, undo of an update. Fields of log record: prevLSN, transID, type Transaction Table - entry for each active transaction- contains trans. Id , status & lastLSN(LSN of most recent log record for the transaction. Status : progress, commited, aborted. Dirty page table one entry for each dirty page in the buffer pool- i.e each page with changes not yet reflected on disk.- contain recLSN(LSN of the first log record that caused the page to become dirty. During normal operation tables are maintained by transactuion manager & buffer manager Suggestions How to prevent Dead locks? Marks Distrib-5 Imp Points: It can be done by giving priority to each transaction & ensuring that lower priority transactions are not allowed to wait for higher priority transactions. One way to assign priority is to give timestamp to each transaction when it starts. The lower the timestamp higher the priority. Suppose Ti & Tj are the two transactions holds conflicting lock, manager can use following polcies: Wait-die: if Ti has higher prio, it is allowed to wait, otherwise it is aborted.- here lower prio transaction never waits for higher prio transaction. Wound-wait: if Ti has higher prio , abort Tj; otherwise Ti waits higher prio transaction never wait for lower prio transaction Conservative 2PL can prevent deadlock Suggestions Discuss the anomalies associated with interleaved transactions. Marks Distrib-5(1+4) if stated 3 -1 mark & even if 2 are explain (2+2) Imp Points: Conflicts two actions on same data objectThe three anomalies : Reading uncommitted data (WR Conflict): Dirty Read Tran 1 reads object A which modified by another trans 2 but not committed yet. Unrepeatable Read(RW Conflict) : never arises in serial execution of 2 transaction

(b)

(c)

(d)

i.e. trans 1 reads object A, Trans 2 also reads A & writes modified Object A. Again Tran 1 try to read A which get different result. Overwriting uncommitted data(WW Conflict): trans 1 modifies the object A which is already modified by trans 2- lost update problem. Suggestions Write in brief about Analysis phase of ARIES. Marks Distrib-5 Imp Points: Tasks performed by Analysis phase: 1. Determines the point in the log at which to start the Redo pass. 2. Determines pages in the buffer pool that were dirty at the time of the crash 3. Identifies transactions that were active at the time of the crash & must be undone. Analysis begins by examining the most recent begin_checkpoint log record & initializing the dirty page table & transaction table to the copies of those structures in the next end_checkpoint rcord . Then analysis scans the log in forward direction until it reaches the end of the log:- If an end log record for trans T is encounterd , T is removed from the transaction table as it not active. if log record other than an end record is found an entry is added to the transaction table if it is not here. entries for transaction T is modified the lastLSN field is set to the LSN of this log recif the log rec is commit rec the status is set to C, otherwixe it is set to U(undone) At the end of analysis the transaction table contains a accurate list of all transactions that were active at the time of the crash. Suggestions What is the need of decomposition? Explain loss-less property of decomposition. Marks Distrib-5 Imp Points: Decomposition consists of replacing the relation(R) schema by two or more relation schemas where each contain a subset of the attributes of original relation(R). This is basically needed to reduce data redundancy (normalization). But still we need to store info in any given instance of relation R by storing Projections of the instance Lossless Join Decomposition :- Decom of R into two schema with attribute set X & Y is lossless with respect to F, if for every instance r of R that satisfies the dependencies in F, X( r ) , y( r ) = r. i.e. recover the original relation from the decomposed. That is If Relation R is decomposed into R1 & R2 through loss less-join decom. & further R1 is decomposed into R11 & R12 then by joining R11 & R12 one can get R1 & again from R1 , R2 one can get R. Suggestions 3. (a) Attempt any Four What is Sequence? How to use sequences explain with example. Marks Distrib-5 (20)

(e)

(f)

(b)

Imp Points: Sequence: that generate series of numeric values. value can be upto 38 digitcan be defined to generate in asc/desc order- allows intervals between numbersallows caching of numbers in memory for faster access. It is independent object , can be used with any table. With following command sequence can be created. Create sequence <seq. name>[ Increment by n] Maxval <n> / Nomaxvalue Minval/Nominvalue Cycle/Nocycle cache<n>/nocache Order/noorder] Once the sequence is created we can use it while inserting data i.e insert into table vales( seq.nextval,..); Nextval Currval are pseudo columns nextval gives next value, currval gives current value of the sequence. Sequence does not intialise until nextval is called. Suggestions Assume Book table consisting of columns bookno, name, no-of_copies & price. Write a PL/SQL code to accept bookno , copies & transaction code( A for add & R for remove). Display current stock & cost (copies*price)of specified book & then update table according to transaction code. Marks Distrib-5 Imp Points: Declare Bno number / book.bookno%type; Tcode char(1); Bkcopy number; Cost number; Pr book.price%type; Cp book.no_of_copies%type; Begin Bno:=&bno; Tcode:=&tcode Bkcopy:=&bkcopy Select no_of_copies,price into cp, pr where bookno=bno; If tcode=A then Cp:=cp+bkcopy; Else Cp:=cp-bkcopy; End if; Cost:=cp*pr; Dbms_outpur.put_line(Stock :||cp||Cost = ||cost); Update book set no_of_copies=cp; Commit; Exception When no_data_found then Dbms_outpur.put_line( No such book exist); End; Suggestions

(c)

(d)

(e)

What is system catalog? Explain its structure. Marks Distrib-5 Imp Points: The collection of files corresponding to users tables & indexes represents the data in the database. A RDMS maintains info about every table & index that it contains. This info itself stored in a collection of special tables called the catalog tables. It contains For each Table:- name, the file name & the file structure of the file in whih it is stored the attribute name & type of each attribute the index name of each index on the table the integrity constraints on the table For each index : the index name & the structure of the index the search key For each view: the view name & its definition. In addition it also stores : Cardinality the no of tuples. Size : no of pages Index cardinality , Index size Ex. Attribute catalog called attrinbute_Cat contains info about table book Attribute_name Rel_name type position Bookno Book integer 1 Book_name Book string 2 No-ofcopies book integer 3 and so on Suggestions With example explain query evaluation plan. Marks Distrib-5 Imp Points: Query evaluation paln consist of extended relational algebra tree, with additional annotations at each node indicating th access methods to use for each table & the implementation method to use for each relational operator. i.e Query is Select B.bname from issued I , book B where B.bno=I.bno and b.bno=101 and I.idate<sysdate() this can be express in relational algebra as banme(bno=101^idate<sysdate(issue|><|bno=bnobook B)) This can shown as tree just given below bname Projection (on-the-fly) | | bno=101 ^ idate<sysdate Selection (on-the-fly) | | |><| Join(simple nested loop) bno=bno / \ issue book file scan Suggestions State the relational operators. Explain the techniques used for evaluation of relational operators. Marks Distrib-5 Imp Points: Relational operators Selection - Projection - Join Techniques used to develop algo for these operators

(f)

Indexing- if selection or join condition is specified, use an index to examine just the tuples that satisfy the condition. Iteration- examine all tuples one after other, If we need only a few fields & there is an index whose key contains all these fields, instead of examining data tuples ,we can scan all index data entries Partitioning by portioning on a sort key , we can often decompose an operation into a less expensive collection of operationson partitions. Sorting & hashing are two commonly use portioning techniques. Suggestions What is cursor? Explain cursor attributes. Marks Distrib-5 Imp Points: Cursor:- an private area for internal processing - to execute SQL statement- Data store in cursor called as active data set. Cursor attributes:<cus name>%found <cus name>%notfound) <cus name>%rowtype; Ex: declare cursor c1 is (select roll,name from student); no c1%rowtype; begin open c1; fetch c1 into no; while c1%found loop Suggestions

4. (a)

Attempt any Four Which activities are involved in project management process? How these activities are grouped? Marks Distrib-5 Imp Points: The Project mgm process specifies all activities that need to be done by the project mgm. to ensure that cost & quality objectives are met. The activities can be grouped broadly into 3 phases as follows: 1. Planning : develop plan for SW development which successfully met all objectives. produce before development activity begins & is updated as development proceeds. 2. Monitoring & Control: phase of longest duration- As cost, schedule & quality are main driving forces, most of the activity revolves around monitoring factors that affect these- monitoring potential risk is another activity- this requires proper info about project 3. termination Analysis: start when development process gets over- also known as Postmortem analysis purpose is to provide info about development process & learn more about improvement. Suggestions State the basic steps in COCOMO. Suppose Inventory module for medical shop

(20)

(b)

has to be designed. The requirements indicate the system is small & size estimated for different sub-modules is as follows: Data Entry & update 1.2 KLOC, Data access 1.0 KLOC, Reports 0.8KLOC Other cost drivers are as follows : Complexity Low 0.88, Storage very high 1.21 Experience high 0.91. Calculate effort adjustment factor, initial effort estimate & adjusted effort estimate. Marks Distrib-5 Imp Points: Basic steps: 1. Obtain an initial stimate of the development effort from the estimateof the thousands of delivered lines of source code(KLOC) 2. Determine a set of 15 mulitiplying factors from different attributes of the project 3. Adjust the effort estimate by multilplying the initital estimate with all the multiplying factor. Problem solution: system is organic : a= 3.2 & b=1.05 Estimate E = EAF * Ei Effort adjustment factor EAF is calculated by multiplying ratings of various cost drivers. Initial estimate Ei=a * (KLOC)b KLOC= 1.2+1.0+0.8 = 3 Ei = 3.2 * (3.0)1.05 = 10.14PM EAF = 0.88*1.21*0.91 = 0.97 E= 0.97*10.14= 9.82 PM Suggestions Which basic functionalities are needed from Configuration management process? Marks Distrib-5 Imp Points: 1. Give latest version of a program. Any modification should be carried out in latest copy. 2. Undo a change or revert back to a specified version- a change is made but later becomes necessary to cancel changes . CM process should allow this smooth operation. 3. Prevent unauthorized changes or deletions- A programmer may decide to change some code just to check any adverse side effect.- CM process must prevent any unapproved change. 4. Gather all sources, documents & other info for the current system. All sources & related files are required for product release. CM process should provide this. Suggestions Explain principles of agile development. Marks Distrib-5 Imp Points: 1. Develop software as your primary goal. 2. Enable the next effort as your secondary goal 3. Minimize your modeling activity- simple

(c)

(d)

4. Embrace change & change incrementally 5. Model with a purpose 6. Build multiple models 7. build high quality models a get feedback rapidly 8. focus on content rather than representation 9. Learn from each other with open communication 10. Know your models & how to use them 11. adapt to specific project needs. Suggestions What is the use of charts like Gantt & PERT/CPM Marks Distrib-5 Imp Points: A PERT/CPM is a diagram of all tasks identified in WBS, indicating sequence of dependencies where rectangle represents a single task or activity within which contains name of the task, unique identifier, duration, beginning & end date. The connecting arrows indicate dependencies ,where some task may go parallely which helps in staffing & work balancing finally help is finding Crititcal Path (longest path covering all activitiesd. Gant Chart helps in monitoring project progress- PERT/CPM activities can be viewed on spread out calendar. x-axis shows dates & on y axis activities. Where one can have PERT schedule & then actual progress. Suggestions State metrics from CK Metrics suite. Explain two of them. Marks Distrib-5 Imp Points: CK (chindamber & Kemerer) is class oriented metrics suite Weighted methods per class(WMC): Assume n methods of compxity c1, c2,cn are define for class C. WMC = ci for i= 1 to n Depth of the inheritance tree(DIT) it maximum length from the noce to the rootof the tree. A deep class heirachy (large DIT) leads to greater design complexity , but it also imply that many methods may be reused Number of children(NOC): As number of children grows , reuse increases- but as NOC increases , abstraction represented by te parent can be diluted, the amount of testing (to execute each child in its operational context) also increases. Coupling between Object classes(CBO): The CRC model may be used to determine CBO. it is number of collaborations listed for a class on its CRC index card consistent with guideline to reduce coupling. Response for a class(RFC): it is a set of methods that can potentially be executed in response to a message received by an object of that class. Lack of cohesion in methods(LCOM): It is number of methods that access one or more same attributes(instance variables)- If no method access same attribute then LCOM is zero- Suppose out of 6 methods four methods have one or more attributes in common then LCOM=4. Suggestions 5. (a) Attempt any Four State the objectives of software testing. Explain any two. (20)

(e)

(f)

(b)

(c)

Marks Distrib-5 Imp Points: Major objectives:Verification- confirms that software meets its technical specifications. Checks that output of each activity meet the requirements 4 levels Component testing, Integration testing system testing & acceptance testing. Validation confirms that software meets business requirement- Testing of device software functionality in simulated use environment, & user site testing are part of components of an overall design validation Defect prevention: defect is an variance between the expected result and actual result.- early defect detection & prevention is key process in development- errors may increase the cost of software. Quality improvement: As people are becoming more dependent of software, quality is imp. factor.- Quality means conformance to the specified design requirement. The main goal of software eng. Is to produce high quality software. Reliability: Reliability can be defined as the probability of failure free operations for a specified period of time in a specific environment. Suggestions Explain following types of testing: Unit Testing, System Testing. Marks Distrib-5 Imp Points: Unit Testing: use to test particular function or module in the code. micro scale testing- The developer carries out unit testing in order to check if the particular module or unit of code is working correctly. comes at basic level as it done as & when the unit is developed or new function is added. requires detail knowledge of program logic & code, it is done by programmer & not by teseter. System testing: is more robust version of the external test, & can be known as alpha test. concentrates on testing the complete system with avariety of techniques & methods.- It comes in picture after unit& integration testing.- the platform must be as close to production use in the customers environment , including hardware setup, database siz & complexity. generally combined with acceptance testing/integration testing Suggestions What are the elements of Software Quality Assurance? Marks Distrib-5 Imp Points: Standards: IEEE,ISO & ther std. organizations produce broad array of software engineering std. The job of SQA is to ensure that stds have been adopted & works with product. Review & audits : Technical reviews are a quality control activity performed by software eng. purpose is to uncover errors Testing: Testing is quality control function Error/defect collection and analysis: Change management Education Vendor management Security management Safety Risk management Suggestions

(d)

What is Black box testing? Discuss the knowledge sources for Black box testing. Marks Distrib-5 Imp Points: It can be considered testing with respect to the specifications & no program knowledge or internal working is necessary. Tester is unaware about coding. Knowledge sources: Requirement Document - Specifications - Domain Knowledge Defect Analysis Data Technique use the specifications or the required behaviour of the software as a starting point to design test cases. The above knowledge sources help in designing proper test cases. Tester comes to know functional properties & expected output as well legal input from these sources. Suggestions Considering following function code draw a flow graph , Find basic paths & calculate cyclomatic complexity. 1 Public void update() { if( upd=Yes) Update record() 2 Exit() Else 3 4 If ( upd = Reset) Clear() 6 Else 5 Exit() } Marks Distrib-5 7 Imp Points: 8 Basic paths : 1-2 N=8 e= 9 p =1 e-n+2p = 9-8+2*1 = 1+2 = 3 Suggestions List the issues/challenges in software testing. Suggest the solution to meet these challenges. Marks Distrib-5 Imp Points: These are the problems in testing for which clear cut solution does not existMeasurement of testing progress - Voluminous test data -Late deploymentTestability of requirement - Misunderstanding the role of testing - Poor planning of the testing - Appointing wrong person as tester - Poor testing methodology Incomplete testing Suggestions

(e)

(f)