• No results found

SOFTWARE VERIFICATION AND VALIDATION

N/A
N/A
Protected

Academic year: 2021

Share "SOFTWARE VERIFICATION AND VALIDATION"

Copied!
42
0
0

Loading.... (view fulltext now)

Full text

(1)

SE 318

SOFTWARE VERIFICATION AND VALIDATION

Online LAB #2

WEEK #8 09.04.2020

(2)

REMINDER!!!

• I have created Trello Boards and put the invitation links to the spreadsheet under Project Grades link below.

https://docs.google.com/spreadsheets/d/1FRGwyr-4vtYc9fCDrX755CtkRBNGLnHIgDIGQpg5KWc/edit#gid=632150433 • Please use only your group's invitation link and join to Trello Boards.

• After that, enter your requirements to Requirements To Do section in your project board.

(3)

ANY QUESTIONS???

• Please check Blackboard and my webpage

(homes.ieu.edu.tr/userhat) periodically for the further announcements.

• Version deadlines (check my webpage)

(4)
(5)

Review: What is JUnit?

• JUnit is a unit testing framework for the Java Programming Language. • It is important in the test driven development, and is one of a family of

(6)

Review: Junit Idea

• JUnit promotes the idea of "first testing then coding", which emphasis on setting up the test data for a piece of code which can be tested first and then can be implemented.

• This approach is like "test a little, code a little, test a little, code a little..." which increases programmer productivity and stability of

(7)
(8)
(9)
(10)

Your Turn Now!

(11)
(12)

TEST TIME

• We are going to test Collaborate for the future online exams.

• Go to Midterm Test from Blackboard menu on the left panel under Panopto Video. • Click to Midterm Test Exam and start doing it.

(13)

PASSWORD

(14)
(15)

Exhaustive Testing is NOT Possible

• Practically, due to time and budget considerations, it is not possible to perform exhausting testing for each set of test data, especially when there is a large pool test cases.

(16)

Specification Based Testing Techniques

• Equivalence Partitioning

• Boundary Value Analysis

• Desicion Tables

(17)

Specification Based Testing Techniques

• Equivalence Partitioning

• Boundary Value Analysis

• Desicion Tables

(18)

Equivalence Partitioning

• It is a black box technique (code is not visible to tester) which can be applied to all levels of testing like unit, integration, system etc.

• In this technique, you divide set of test condition into partition that can be considered the same.

• To get a better idea let see an example.

(19)
(20)

Example: Flight Reservation Application (cont’d)

• Ticket values 1 to 10 are considered valid & ticket is booked.

(21)

Example: Flight Reservation Application

(22)

Here is the test cases:

1. Any Number greater than 10 entered in the reservation column (let say 11) is considered invalid.

2. Any Number less than 1 that is 0 or below, then it is considered invalid. 3. Numbers 1 to 10 are considered valid 4. Any 3 Digit Number say -100 is invalid.

(23)

• We cannot test all the possible values because if done, number of test cases will be more than 100.

• To address this problem, we use equivalence partitioning hypothesis where we divide the possible values of tickets into groups or sets as shown in the next slide where the system behavior can be considered the same.

(24)

Example: Flight Reservation Application

(25)

Example: Flight Reservation Application

• The divided sets are called Equivalence Partitions or Equivalence Classes.

• Then we pick only one value from each partition for testing.

• The hypothesis behind this technique is that if one condition/value in a partition passes all others will also pass.

• Likewise, if one condition in a partition fails, all other conditions in that partition will fail.

(26)
(27)

• In Boundary Value Analysis, we test boundaries between equivalence partitions.

• In our earlier example instead of checking, one value for each partition you will check the values at the partitions like 0, 1, 10, 11 and so on. • As you may observe, you test values at both valid and invalid

boundaries.

(28)
(29)

Your Turn Now!

(30)
(31)

• Code coverage is a measure which describes the degree of which the source code of the program has been tested.

• It is one form of white-box testing which finds the areas of the program not exercised by a set of test cases.

• It also creates some test cases to increase coverage and determining a quantitative measure of code coverage.

• In most cases, code coverage system gathers information about the running program. • It also combines that with source code information to generate a report about the test

suite's code coverage.

(32)

• In this the test case is executed in such a way that every statement of the code is executed at least once.

(33)

• Test coverage criteria requires enough test cases such that each

condition in a decision takes on all possible outcomes at least once, and each point of entry to a program or subroutine is invoked at least once.

• That is, every branch (decision) taken each way, true and false.

• It helps in validating all the branches in the code making sure that no branch leads to abnormal behavior of the application.

(34)

Path Coverage

• In this the test case is executed in such a way that every path is executed at least once.

• All possible control paths taken, including all loop paths taken zero, once, and multiple (ideally, maximum) items in path coverage technique, the test cases are prepared based on the logical complexity measure of a procedural design.

• In this type of testing every statement in the program is guaranteed to be executed at least one time.

(35)

How to Calculate Statement Coverage, Branch

Coverage and Path Coverage?

• Draw the flow in the following way:

(36)

Example

Read P Read Q IF P+Q > 100 THEN Print “Large” ENDIF If P > 50 THEN Print “P Large” ENDIF

(37)
(38)

Example (cont’d)

Statement Coverage (SC):

• To calculate Statement Coverage, find out the shortest number of paths following which all the nodes will be covered.

• Here by traversing through path 1A-2C-3D-E-4G-5H all the nodes are covered.

(39)

Example (cont’d)

Branch Coverage (BC):

• To calculate Branch Coverage, find out the minimum number of paths which will ensure covering of all the edges.

• In this case there is no single path which will ensure coverage of all the edges at one go.

• By following paths 1A-2C-3D-E-4G-5H, maximum numbers of edges (A, C, D, E, G and H) are covered but edges B and F are left.

• To covers these edges we can follow 1A-2B-E-4F.

• By the combining the above two paths we can ensure of traveling through all the paths.

(40)

Example (cont’d)

Path Coverage (PC):

Path Coverage ensures covering of all the paths from start to end. All possible paths

are-1A-2B-E-4F

1A-2B-E-4G-5H

1A-2C-3D-E-4G-5H 1A-2C-3D-E-4F

(41)

Example (cont’d)

• Thus for the above example SC=1, BC=2 and PC=4. • Memorize these….

• 100% LCSAJ coverage will imply 100% Branch/Decision coverage. • 100% Path coverage will imply 100% Statement coverage.

• 100% Branch/Decision coverage will imply 100% Statement coverage. • 100% Path coverage will imply 100% Branch/Decision coverage.

• Branch coverage and Decision coverage are same.

(42)

References

Related documents

Subvisual cirrus (SVC) ice particle size distributions (com- bined FSSP-100 and CIP in situ data) from 7, 8, and 11 August 2006 over West Africa.. The horizontal extent was

All of the participants were faculty members, currently working in a higher education setting, teaching adapted physical activity / education courses and, finally, were

b In cell B11, write a formula to find Condobolin’s total rainfall for the week.. Use Fill Right to copy the formula into cells C11

Here, we present results from the Water, Sanitation, and Hygiene for Health and Education in Laotian Primary Schools (WASH HELPS) study, a cluster-RCT designed to measure the impact

Code coverage approach is to ensure that all the statements and paths in the code are executed. This may not find bugs but can identify areas of code which are not

How Many Breeding Females are Needed to Produce 40 Male Homozygotes per Week Using a Heterozygous Female x Heterozygous Male Breeding Scheme With 15% Non-Productive Breeders.

The aim of this study was to evaluate the current vac- cination status of the HCWs in all of the Departments different from the Department for the Health of Women and Children of one

Furthermore, while symbolic execution systems often avoid reasoning precisely about symbolic memory accesses (e.g., access- ing a symbolic offset in an array), C OMMUTER ’s test