Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

swer these questions based on your self-study Gliowhatis aqrep searghn When will

ID: 3754084 • Letter: S

Question

swer these questions based on your self-study Gliowhatis aqrep searghn When will it fail? What process you would in the faîled situation? 02: Code clutters make the software large and complex. How do vou rectify this? Why do you need to remove clutter and complexity in software? Give án example of a situation where you need this ·03: What process you use to handle software requirements such that the required fünctions are implemented as customers wish? ·4: Incremental and refactoring of software change process impacts what? and why? What is the classification from this point of view? . Q5: Extract the significant concepts from the following change request: The bank application allows the users to open only two accounts: checking and savings. Allow the users to open certificate of deposit accounts." Justify your answer.

Explanation / Answer

Q1:

Grep is a unix searching tool that takes a regular expression and file name as and input and returns the set of lines in the given file that match with the regular expression.

It fails when regular expression does not match anything.

Grep returns exit status that can be used whether it has found something or not. It returns zero on success, a non-zero value otherwise. We can use if-else to gracefully handle the cases when grep search fails. In an "if" statement a zero exit code is mapped as true and non-zero as false.

Q2:

We can rectify code clutter by replacing every long function with shorter functions. While writing code we have to keep in mind that a function should not be doing more than its name suggest and also that it does not perform more than one action (or logic). If any function includes two or more completely separate logic then we can replace it with shorter functions where each function inplements one logic.

We need to remove clutter to achieve better readability. It should be easily understandable by anyone who has not developed that code. It usually happens that the large softwares are developed and maintained by different people.

Example:

In a function I may need to modify contents of an array multiple times and every time I do that I print its contents to the console. In this case, I may write the printing code every time the array is modified. To avoid this repetition of code I can write another function that will print the contents of the array and call this function instead every time I want to print the array.

Q3:

I will use requirement tracing to ensure that the required functions are implemented as customer's wish. It traces the requirements from the initial development process till the software is delivered to the user. It makes sure that the requirements are correctly understood and it also verifies that all the features (or functions) are implemented as per the requirement specification.

Q4:

Incremental and Refactoring of software change impact the architecture of a program without changing its functionality. It does so to minimize the impact of the change on the program. It removes the anti-patterns that are introduced in the code and makes it clearer and easy to maintain.