3 views

Uploaded by Agum Junianto

Basis path testing technique

- Chapter Contents Java Data Structures Book
- For Math Majors
- EQ-502 Curve Fitting - Sinusoid
- PaolellaIntermediateProbabilityErrata
- Bresenham_s Line Drawing Algorithm
- Sec7.1
- CSEC January 2016 Mathematics P2 MS
- NMRV Dimensions
- Emailing with PHP
- new 2
- Butterfly coding
- How to Create Requirements Traceability Matrix
- Attribute
- SEM 2 BC0039 Discrete Mathematics
- Analisis Numerik_Kel 2-1
- SIR list
- Update Program Guide
- differentiation
- Equation of a Line Pdf1
- Hcl chetan

You are on page 1of 6

PROCEDURE average:

This procedure computes the average of 100 or fewer numbers that lie between bounding

values; it also computes the sum and the total number valid

INTERFACE returns average, total.input, total.valid;

INTERFACE accepts value, minimum, maximum;

TYPE value[1:100] IS SCALAR ARRAY;

TYPE average, total.input, total.valid, minimum,maximum,sum IS SCALAR;

TYPE i is integer;

i=1;

1 2

total.input = total.valid = 0;

Sum=0;

Do while value[i]<>-999 and total.input <= 100 3

4 increment total.input by 1;

IF value[i] >= minimum and value[i] <=maximum 6

5 THEN increment total.valid by 1;

7 sum = sum + value[I];

8 ENDIF

increment i by 1;

9 Enddo

IF value[i] >0 10

11

THEN average = sum / total.valid;

ELSE average = -999;

12 ENDIF 13 1

Basis Testing Example

1

10

3

12 11 4

13

5

7

8

9

2

Basis Testing Example

Compute cyclomatic complexity

V(G)= 17 edges 13 nodes + 2 = 6

Determine sets of independent paths

1 = 1-2-10-11-13

2 = 1-2-10-12-13

3 = 1-2-3-10-11-13

4 = 1-2-3-10-12-13

5 = 1-2-3-4-5-8-9-2-

6 = 1-2-3-4-5-6-8-9-2-.

Or is it???

3

Correction

Oops, the previous page is WRONG.

Determine set of independent paths

1 = 1-2-10-11-13

2 = 1-2-3-10-12-13

3 = 1-2-3-4-5-8-9-2-

4 = 1-2-3-4-5-6-8-9-2-

5 = 1-2-3-4-5-6-7-8-9-2-

Why arent there six?

4

Basis Testing - Example

Prepare Test Cases for each

Test case path 1

Value(k) is value k < i i >= 2 i <=100

Value i = -999 same range

Expected result: correct average based on k values and

proper totals

Test case path 2

Value(1) = -999

Expected results : average = -999; other totals are the

initial values

Test case path 3

Attempt to process 101 or more values

First 100 should be valid

5

Expected results as test case 1

Basis Testing Example

Test case path 4

Value(i) = valid input where i < 100

Value(k) < minimum where k < i

Expected results: correct average based on k values and

proper totals

Test case path 5

Value (i) = valid input where i < 100

Value(k) > maximum where k=i

Expected results: correct average based on n values and

proper totals

Test case path 6

Value(i) = valid input where i < 100

Expected results: correct average based on n values and

proper totals

6

- Chapter Contents Java Data Structures BookUploaded byCarlos Ruiz
- For Math MajorsUploaded byEugene Patrick Monterico
- EQ-502 Curve Fitting - SinusoidUploaded byadpanfeq
- PaolellaIntermediateProbabilityErrataUploaded byLinaena Mericy
- Bresenham_s Line Drawing AlgorithmUploaded bymahesh
- Sec7.1Uploaded byTheGreatPostulio
- CSEC January 2016 Mathematics P2 MSUploaded byLatoyaWatkins
- NMRV DimensionsUploaded byDarko Marjanovic
- Emailing with PHPUploaded byNerlesh Cr
- new 2Uploaded byPraveen Pamnani
- Butterfly codingUploaded bySuresh Manjini
- How to Create Requirements Traceability MatrixUploaded byAngelica Camille Mallari
- AttributeUploaded byabu1882
- SEM 2 BC0039 Discrete MathematicsUploaded byme_ajeesh
- Analisis Numerik_Kel 2-1Uploaded byFaila Putri
- SIR listUploaded byBilal Masri
- Update Program GuideUploaded bypulkit911
- differentiationUploaded byapi-357527801
- Equation of a Line Pdf1Uploaded bydmal88
- Hcl chetanUploaded bysvas_9
- Matlab ClassUploaded bymugenhas
- S7 MicroWinUploaded byMargozata
- os_lab 5,6Uploaded byAakshi Agarwal
- 2.guidUploaded bySathya
- Lecture 5-Case StructureUploaded byMarke Green
- Pwo Error LogUploaded bychristiannivek
- Accenture Placement Paper Pattern and Interview Questions - 4Uploaded byKavya Anand
- homework - simple inequalitiesUploaded byapi-368121935
- Billing to MiroUploaded byErica Romero
- joinUploaded bykardeslerim123

- 6030847.pdfUploaded byfitrah fajriani
- Line AlgorithmsUploaded byKunal
- 8 Ways to Raise Your VibrationUploaded byAmarrdiip Siingh
- Moms Exam 1 Study GuideUploaded byNate Demissie
- honoring diversity checklistUploaded byapi-235065651
- Small ScaleUploaded byMichael DoctorSlime Garlick
- Collapsed StructuresUploaded byhello3232
- Wayfinding Handbook.pdfUploaded byAdrianaLissetteDeLaCorteContreras
- Instructional Methods InformationUploaded byMohammad Mossad
- CDI Fuzzy ToolboxUploaded bymari23000
- Automated Car Parking SystemUploaded byRima Kanekar
- Office Communications Server 2007 R2 Technical Reference GuideUploaded bymdTarique
- Introecon Normal DistUploaded byShahzad Ahmed
- Exam P SampleUploaded bybezner_paul
- AT Command Set for Nokia GSM Products.pdfUploaded byHao Nv
- CollectionsUploaded byKrishna Murti Pathak
- ReferencesUploaded byAnkush Kadam
- Review of SQL SELECT Statements_l1Uploaded byradebap
- Building an ArgumentUploaded byapi-26664469
- tasting the hardness of water.pdfUploaded byAnonymous XcoRUnF
- Daniel Miller (2012) -Digital-Anthropology.pdfUploaded byAndrés Abad
- 1Z548Uploaded byqaraqesho
- amico-ci-lxsg-15-40e.pdfUploaded byAgam Alfian Nazri
- Global Wood Density DatabaseUploaded byIgnacio Larco Roca
- MosheIdel-MessianicMystics.pdfUploaded bySoftbrain
- math lesson planUploaded byapi-351996034
- vtu se syllabusUploaded byoceanparkk
- Western Civilization Final ExamUploaded byAryann Van Keridwen
- SQL Server 2005 Integration ServicesUploaded byLearnItFirst
- LEAN CONSTRUCTION.docxUploaded byThaliaTicllaRios