CS504 Final Term Solved Subjective Set 2 by Junaid
- Type
- Final term past paper
- Course
- CS504 Software Engineering - I
- Size
- PDF 1.3 MB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 2, 3, 4 of 18. Download the file for all 18 pages.
Q1. ( Marks: 2 )
What is Software Testing?
Answer: (Page 192) To understand the concept of software testing correctly, we need to understand a few related concepts.
Q2. Write unit testing qualitative benefits. (2 marks)
Answer: (Page 207) Assessment-oriented: Writing the unit test forces us to deal with design issues - cohesion, coupling. Confidence-building: We know what works at an early stage. Also easier to change when it’s easy to retest.
Q3. Where Term Compute can be used in Methods? (2 marks)
Answer: (Page 152) The term compute can be used in methods where something is computed. valueSet.computeAverage(); matrix.computeInverse()
Q4. Which of the following is a/are non-functional requirement of an e-learning system? (2 marks)
(e) Robustness
Answer: (a) User friendliness
Q5. Write unit testing principles. (3 marks)
Answer: (Page 207)
- In unit testing, developers test their own code units (modules, classes, etc.) during implementation.
- Normal and boundary inputs against expected results are tested.
- Thus unit testing is a great way to test an API.
Q6. The use of do .... while loops should be avoided. Explain why ? (3 marks)
Answer: (Page 159) The use of do .... While loops should be avoided. There are two reasons for this. First is that the construct is superfluous; Any statement that can be written as a do while loop can equally well be written as a while loop or a for loop. Complexity is reduced by minimizing the number of constructs being used. The other reason is of readability. A loop with the conditional part at the end is more difficult to read than one with the conditional at the top.
Q7. ( Marks: 3 )
Give 3 Equivalence partitioning guidelines
Answer: (Page 199)
- Organize your equivalence classes. Write them in some order, use some template, sequence, or group them based on their similarities or distinctions. These partitions can be hierarchical or organized in any other manner.
- Boundary conditions: determine boundary conditions. For example, adding in an empty linked list, adding after the last element, adding before the first element, etc.
- You should not forget invalid inputs that a user can give to a system. For example, widgets on a GUI, numeric instead of alphabets, etc.
Q8. ( Marks: 5 )
Discus the symptoms and an example of memory overrun bug class.
Answer: (Page 220) Symptoms
- Program crashes quite regularly after a given routine is called, that routine should be examined for a possible overrun condition.
- If the routine in question does not appear to have any such problem the most likely cause is that another routine, called in the prior sequence, has already trashed variables or memory blocks.
- Checking the trace log of the called routines leading up to one with the problem will often show up the error.
Example The array only has 50 slots available in its allocation. What happens at that point is that the function goes past the end of the array and starts to walk on things beyond its control. const kMaxEntries = 50;
int gArray[kMaxEntries]; char szDummyBuffer[256]; int nState = 10; int ZeroArray (int *pArray)
for (inti=0;i<100;++i) pArray[i] = 0;
Q9. Write at leas 5 General Naming conventions for C++ or Java (5 marks)
Answer: (Page 150)
- Names representing types must be nouns and written in mixed case starting with upper case.
Line, FilePrefix
- Variable names must be in mixed case starting with lower case.
line, filePrefix
- Names representing constants must be all uppercase using underscore to separate words. MAX_ITERATIONS, COLOR_RED
- Names representing methods and functions should be verbs and written in mixed case starting with lower case.
getName(), computeTotalWidth()
- Names representing template types in C++ should be a single uppercase letter.
template<class T> template<class C, class D>
Q10. Explain at least 2 code structures. (5 marks)
Answer: (Page 201)
Case:-
In Case statement, control can take either of several branches (as opposed to only two in If statement.) First node represents the switch statement (C/C++) and nodes in middle correspond to all different cases. Program can take one branch and result into the same instruction.
While
A while loop structure consists of a loop guard instruction through which the iteration in the loop is controlled. The control keeps iterating in the loop as long as the loop guard condition is true. It branches to the last instruction when it becomes false.
Q11. What does this mean” Object Creation and Life Time”? (2 marks)
Answer: (Page 87) From the object creation and life time point of view, when an object is instantiated, all of its parts must also be instantiated at the same time before any useful work can be done and all of its part die with it. While in the case of association, the life time of two associated object is independent of one another. The only limitation is that an object must be alive or has to be instantiated before a message can be sent to it.
Q12. How one can avoid hazards caused by side effects while writing code. List the two guidelines. (2 marks)
Answer: (Page 176) never use “,” except for declaration never use multiple assignments in the same statement
Q13. What is the greatest advantage of exception handling? (2 marks)
Answer: (Page 184) One of the most powerful features of exception handling is that an error can be thrown over function boundaries. This allows programmers to put the error handling code in one place, such as the main-function of your program.
Q14. Give 2 Unit Testing Tips. (2 marks)
Answer: (Page 208)
- For small projects you can imbed the unit test for a module in the module itself
- For larger projects you should keep the tests in the package directory or a /test subdirectory of the package
Related CS504 files
All CS504 files →- CS504 Final Term Solved Papers Mega File Final term DOC 436 KB
- CS504 Final Term MCQs by Waqar Siddhu Final term PDF 17 MB
- CS504 Final Term Solved MCQs Set 3 by Junaid Final term PDF 2.1 MB
- CS504 Final Term Solved MCQs Set 2 by Junaid Final term PDF 1.8 MB
- CS504 Highlighted Handouts by 404 Highlighted PDF 3.3 MB
- CS504 Quiz 1 Lectures 1-15 by Junaid Quiz PDF 973 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.