King’s College London
This paper is part of an examination of the College counting towards the award of a degree. Examinations are governed by the College Regulations under the authority of the Academic Board.
EXAMINATION PERIOD August 2020 (Period 3)
MODULE CODE(S) AND TITLE OF EXAMINATION: 7CCSMASE Software Measurement and Testing
FORMAT OF EXAMINATION: Written questions
START TIME: 1pm (BST) 1 September 2020
TIME ALLOWED: 2 hours (Including upload time)
INSTRUCTIONS: You are permitted to access any materials you wish, but this is not mandated and is not expected. You may use a calculator if you find this helpful.
All : Written Exam : 3 questions Three out of three questions, no choice. The questions combine bookwork with problem-solving, based on the material taught in class (lectures and tutorials). The maximal amount of marks per subquestion is specified next to each subquestion. Marks are not deducted for wrong answers.For answers that are handwritten, write with blue/black ink on light coloured paper. Include the Module code, question number and student number on every page to be submitted.
For answers that are typed, use the template provided.
SUBMISSION DEADLINE: 3pm (BST) 1 September 2020
SUBMISSION PROCESS: Work must be submitted to the level 7 Informatics Assessments KEATS page.
Your work must be submitted as a PDF file. If you have prepared some answers on computer, and some on paper (which have then been digitised), you may upload at most two PDF files — one for computer-prepared answers, one for digitised answers. Do not duplicate answers across the two PDFs – if you do this, the computer-prepared answer will be taken.
You should check that your work displays correctly after it has been uploaded.
ACADEMIC HONESTY AND INTEGRITY
Students at King’s are part of an academic community that values trust, fairness and respect and actively encourages students to act with honesty and integrity. It is a College policy that students take responsibility for their work and comply with the university’s standards and requirements. Online proctoring/invigilation will not be used for our online assessments. By submitting their answers students will be confirming that the work submitted is completely their own.
Misconduct regulations remain in place during this period and students can familiarise themselves with the procedures on the College website
Students should copy out the following statement and include it with their submission for each examination:
I agree to abide by the expectations as to my conduct, as described in the academic honesty and integrity statement.
test using this method.
(5 marks) [30 marks]
7CCSMASE Advanced Software Engineering
Question 1
(a) Explain the difference between correctness and reliability.
(5 marks)
(b) Explain the difference between reliability and safety. Give one example of a system that is reliable but unsafe. (5 marks)
(c) Define the notion of black-box testing and give one example of a black-box testing technique. (5 marks)
(d) Define the notion of fault-based testing and give one example. (5 marks)
(e) Define the notion of random testing. Give one example where it might be useful. (5 marks)
(f) Define the notion of model-based testing and explain what we can
2
SEE NEXT PAGE
(a) Draw the control graph of the program.
(b) Annotate the nodes within your graph to indicate the
7CCSMASE Advanced Software Engineering
Question 2
For the following program computing the Ethiopian multiplication:
public int ethiopian(int x, int y) {
int result=0;
while(x >= 1) {
if ( (x & 1) != 0) {
result = result + y;
}
}
return result;
}
x = x >> 1;
y = y << 1;
(5 marks) definitions/uses of all variables (x, y, and result). (5 marks)
(c) Define statement coverage and build a minimal test suite with 100% statement coverage for this program. (5 marks)
(d) Define a coverage metric that subsumes statement coverage and build a minimal test suite with 100% coverage for this program with respect to the metric you defined. (6 marks)
(e) Does subsumption mean that any error discovered by a test suite with 100% statement coverage will always be discovered by a test suite with 100% coverage with respect to the metric you defined in (d)? Justify your answer. (6 marks)
(f) Define one other structural coverage metric and give an example (a statement or a short program). (8 marks)
3
[35 marks]
SEE NEXT PAGE
7CCSMASE Advanced Software Engineering
Question 3
A software for allocation of undergraduate modules to lecturers analyses valid module records at NMS. The parameters in the records are:
• Module name in the format [4..6]CCS[1..3]
• Three letters standing for the name of the lecturer (three first letters of the lecturer’s last name). For example, CHO is a valid value.
• Code describing the type of the module: 01 for core module, 02 for mandatory module, and 03 for optional module.
(a) Define the notion of combinatorial testing. (5 marks)
(b) Define categories for each parameter in the software for the software for allocation of undergraduate modules to lecturers.
(6 marks)
(c) Give representative values for each category for each parameter. (6 marks)
(d) Calculate how many tests are needed to give full coverage of the categories. (6 marks)
(e) Define two reasonable error constraints. Re-calculate the number of tests needed for full coverage of the categories, assuming that an error constraint can be checked with a single test. (6 marks)
(f) Build a table of tests that give 100% pairwise coverage with respect to the categories above. (6 marks)
[35 marks]
4
FINAL PAGE SEE NEXT PAGE