Software Testing

23
Software Testing IT323 - Software Engineering 2 1 Tutorial 6

description

Software Testing. Tutorial 6. IT323 - Software Engineering 2. Q1. Using your java, C# or other programming language skill, derive a checklist of common errors (NOT syntax errors) that could not be detected by a compiler but that could be detected in a program inspection? . Answer :. - PowerPoint PPT Presentation

Transcript of Software Testing

Page 1: Software Testing

Software Testing

IT323 - Software Engineering 2 1

Tutorial 6

Page 2: Software Testing

Using your java, C# or other programming language skill, derive a checklist of common errors (NOT syntax errors) that could not be detected by a compiler but that could be detected in a program inspection?

2

Q1

Page 3: Software Testing

Dynamic variables are cleared properly when they’re no longer needed

Recursive functions have logic to prevent infinite recursion Iterative loops have logic to prevent infinite loops Variables are not in danger of being too limited with large

numbers Logic statements are defined correctly

3

Answer :

Page 4: Software Testing

An item in inventory can have a quantity of - 9999 to + 9999, identify the test cases from this specification using partition testing.

4

Q2

Page 5: Software Testing

The equivalence partitions are:

If x < -9999 If -9999 ≤x ≤+9999 If x > +9999

Test cases: {-10000, -9999, 0, +9999, 10000}

5

Answer :

Page 6: Software Testing

A headmaster enter the students level . She will enter P if the student in primary school . She will enter I if the student in Intermediate school . She will enter S if the student in Secondary school. identify the test cases from this specification using partition testing

6

Q3

Page 7: Software Testing

The equivalence partitions are:

If code = P If code = I If code = S If code is not one of P, I, S

Test cases: {P, I, S, any other character}

7

Answer :

Page 8: Software Testing

What are the test data that best demonstrates equivalence partitioning for a program that checks the weather in Boston. It's snowing if the degree is less than -10, cold if it (between -10 and 10), cool if it (between 10 and 26) and hot if it more than 26?

8

Q4

Page 9: Software Testing

The equivalence partitions are:

If -10> Weather If -10<=Weather<=10 If 10< Weather <=26 If 26< Weather

Test cases: {-11,-10,0,10,18,26,27}

9

Answer :

Page 10: Software Testing

According to the following Ticket price for theme park table, derive the test cases using partition testing.

The Discount Table

10

Q5

Page 11: Software Testing

11

Answer :The equivalence partitions are:

If 0<=age<=6 If 7<=age<=17 If 18<=age<=64 If 64<age If x < age

Test cases: {-1 ,0, 3, 6, 7, 12, 17, 18, 41, 64, 65}  

Page 12: Software Testing

Given this object:

Derive the test cases that cover this object. Also, derive three state sequence tests.

12

Q6

ReportFontNumberOfPagesOrientationMargins

PrintReport()ClearContents()UndoClearContents()EditingDate()ChangeFont(fontType)

Page 13: Software Testing

13

Answer : Test attribute values (different values , boundaries) Test each method Test combination of methods

Example of state sequence: ChangeFont() > ClearContents() > UndoClearContents() EditingDate() > PrintReport() > EditingDate() ChangeFont() > PrintReport() > EditingDate()

Page 14: Software Testing

Given these two components:

Derive Guidelines for this type of component interface. Also, list the test cases for each guideline.

14

Q7

Report Component

Formatting Component

Format ( str color, str font, int fontSize)

Format ( str color, str font, int fontSize)

Page 15: Software Testing

15

Answer :Guidelines are the same of guidelines for testing Parameter Interface, They are briefly:

Test parameters with valid and invalid values Test parameter with extreme ends of their ranges Test null pointers

Page 16: Software Testing

Given this part from Pizza restaurant website requirements:

16

Q8

-If a customer orders on Monday between 12 and 4 p.m., then the website shall ask the customer if he like to order Monday’s offer (Take 2 medium pizzas for 40 SR).

-If the customer’s order is the 10th order, then the website shall provide 20% discount for his recent order.

Page 17: Software Testing

17

Answer :Req-1-

Test if the day and the time are known in the system Set up the time and day to be another day than Monday or another

time not between 12 and 4 p.m.., test if the system display msg to ask the customer about the offer.

Set up the time and day to be Monday from 12-4 p.m., test if the system display msg to ask the customer about Monday offer or not.

If the msg is displayed, test if it is correctly issued.

Page 18: Software Testing

18

Answer :Req-2-

Test if the system counts orders for each customer Set the order number to be < or > the 10th order, test if a discount is

applied or not. Set the order number to be the 10th order, test if the discount is applied

or not. If the system applies discount for the 10th order, check if it is 20% or

not Test if the system applies 20% correctly

Page 19: Software Testing

Explain the relation between Agile methods and Alpha testing, Beta testing and acceptance testing.

19

Q9

Page 20: Software Testing

20

Answer :Agile and Alpha testing: agile advocate user involvement in the development process and that users should play a key role in designing test for the system. So, it is a part of agile.

Agile and Beta testing: No beta testing in agile because the developers in agile do not make the releases available in the open market or in public.

Agile and acceptance testing: in agile, acceptance testing has a rather different meaning. The tests in agile are automated and development does not proceed until the story acceptance tests have passed. So, there is acceptance testing in agile but it is not as a separated activity.

Page 21: Software Testing

What is the difference between stress testing and regression testing?

21

Q10

Page 22: Software Testing

22

Answer :Stress testing: stressing the system by making demands that are outside the design limits of the software. It is used in the performing testing (release testing) and for Message interface testing (component testing >> development testing).

Regression testing: is testing the system to check that changes have not ‘broken’ previously working code. It is used when adding new function or apply new change ( in TDD and integration testing).

Page 23: Software Testing

Thank you

23