Skip to main content

程序代写案例-JANUARY 2019

By January 13, 2021No Comments

OLLSCOIL NA hÉIREANN MÁ NUAD THE NATIONAL UNIVERSITY OF IRELAND MAYNOOTH JANUARY 2019 EXAMINATION CS265 Software Testing Dr. M. Huggard, Dr. J. Timoney, Dr. R. Bierig Time allowed: 2 hours Answer at least three questions Your mark will be based on your best three answers All questions carry equal marks CS265 Page 1 of 5 January 2019 1. [25 marks] (a) The term ‘software crisis’ was coined at the end of 1960s / beginning 1970s. Explain what the term means in its historical context, highlight specific problems that were associated with it, and explain what positive results it had for the software industry in relation to these problems. [13 marks] (b) We learnt about software faults and how they can be categorised into different classes. List and describe five types of software faults. What are the most common types of software faults from this list? [12 marks] CS265 Page 2 of 5 January 2019 2. [25 marks] (a) Explain the difference between the concepts of Static and Dynamic software verification. [7 marks] (b) Explain what an “Error of Commission” is. Give a simple example of this type of error. Explain how this type of error can be addressed through testing and demonstrate how this operates in the context of the example you have given. [12 marks] (c) Explain the following three terms for the SCRUM approach to software development. Draw a diagram to highlight how these three terms relate to each other: [6 marks] i. Product Backlog ii. Sprint Backlog iii. Sprint CS265 Page 3 of 5 January 2019 3. Consider the following Specification: [25 marks] A program for booking bus tickets generates the level of discount available depending on the age of the traveler as an input: The age is the input and is represented as an integer value; children under 5 years travel free; children and young adults between the ages of 5 and 16 years inclusive receive a 50% discount; those aged 65 and over get a 25% discount. An entry of less than 1 year and greater than 110 years is incorrect and the discount value that is returned is -1% to reflect the error. (a) From the specification work out the test cases and test data for the testing methods of i. Equivalence Partitioning [10 marks] ii. Boundary Value Analysis [10 marks] (b) Give two advantages that ‘Boundary value analysis’ has over ‘Equivalence partitioning’. [5 marks] CS265 Page 4 of 5 January 2019 4. (a) Consider the following specification: [7 marks] /* The basic cost of an insurance premium for drivers is €500, however, this premium can increase or decrease depending on three factors: their age, their gender and their marital status. Age is an integer. Gender is given by the character ’M’ for male and ’F’ for female. ‘Married’ is a boolean value. Drivers below the age of 25, male and single face an additional premium increase of €1500. If a driver outside of this bracket is married or female their premium reduces by €200, and if they are aged between 45 and 65 inclusive, their premium goes down by €100. Drivers below the age of 16 and greater than the age of 65 cannot be insured and will return a value of zero for the premium. Program error checking to prevent an illegal entry for gender will also return a value of zero for the premium. */ static int premium(int age, boolean accidentFree, boolean married) For the ‘Car Insurance’ specification above find the causes and effects in preparation for a truth table. You do not need to construct the truth table. CS265 Page 5 of 5 January 2019 (b) Consider the following specification: [18 marks] orderCheck() is part of a software suit that checks orders received from ordering customers. The method uses three values: the order quantity, the ‘good credit status’ of the customer, and the current inventory quantity.
The program output is a text. Depending on the values of the three parameters, the output will be one of the following: “Accept”, “Defer”, or “Reject”. The calculation is as follows: If the ordered quantity is smaller than or equal to 500 items (the maximum limit), and the customer has good credit, and the inventory is larger than or equal to the ordered quantity, then the order will be accepted.
If the ordered quantity is smaller than or equal to the maximum limit, and the customer is credit-worthy, but the inventory is less than the ordered quantity, then the order will be deferred. For all other cases, orders will be rejected. Interface for method orderScreening: public static String orderCheck(int quantity, boolean good_credit, int inventory); Also consider the following incomplete truth table: i. Complete the truth table and highlight impossible rules in the table, if applicable ii. Develop test data for your truth table iii. How many test cases would you get if there would be another boolean variable ‘bonusMember’ as an additional cause (with everything else equal)? R1 Cause 0 <= quantity <= 500 good_credit quantity <= inventory Effect Output = “Accept” Output = “Defer” Output = “Reject”


Author admin

More posts by admin