• No results found

Component - - Based White Based White - - Box Testing Box Testing

N/A
N/A
Protected

Academic year: 2022

Share "Component - - Based White Based White - - Box Testing Box Testing"

Copied!
26
0
0

Loading.... (view fulltext now)

Full text

(1)

Component

Component - - Based White Based White - - Box Testing Box Testing

By

Prathab K

(Roll No: 06329902)

Under the guidance of

Prof. Deepak B. Phatak

(2)

Outline Outline

Component-based software development

Software component testing

White-box testing methods for software components

Systematic procedure for white-box testing of software components

Conclusions & Future work

(3)

Component

Component- - based Software Development based Software Development

(4)

Software Components Software Components

What is software component?

– confirms to a component model – independently deployable

– composed according to a composition standard (EJB, CORBA, or COM+)

Reuse

Software components System assembly Notion of components

(5)

Engineering process for software components Engineering process for software components

Component-based software development involves:

– Component qualification – Component adaptation

– Assembling components into systems – System evolution

off-the-shelf components

qualified components

adapted components

assembled components

updated components

States

qualification to discover interface and fitness for use

adaptation to remove architectural mismatch

composition into a

selected architectural style

evolution to updated components Activities/

Transformations

(6)

Software Component Testing

Software Component Testing

(7)

Testing software components Testing software components

Involves

– Testing individual components

– Testing interaction among components

Necessity

– Inconsistent infrastructure and environment – Inconsistent interaction model

Challenges

– Lack of source code availability – Performance and reliability analysis – Test Adequacy criteria

(8)

Testing Interface Component

Component

Methods to increase component testability Methods to increase component testability

Component testability

– degree of component facility for component testing

Components

Testing Framework

Component F1 T F2 T

Component F

F

T1 T2

Framework-based testing facility[4] Built-in tests[5] Systematic component wrapping for testing (testable beans)[6]

[4] Stocks, P. A., and Carrington, D. A, “A Framework for Specification-Based Testing”

[5] Wang, Yingxu, King, Graham, and Wickburg, Hakan, “A Method for Built-in Tests in Component-based Software Maintenance”

[6] Gao, J., et al., “On Building Testable Software Components”

(9)

White

White - - box Testing Methods for Software box Testing Methods for Software Components

Components

(10)

White

White - - box testing box testing

“Testing that takes into account the internal mechanism of a system or component”

White-box vs Black-box testing?

– Black-box testing against the specification – White-box testing against the implementation

Is white-box = unit testing?

– Not exactly!

(11)

Flow graph notation Flow graph notation

Flow graph notation represents the structure of the program

S1: Integer MinElement (Array A){

S2: min = Interger.MAX;

S3: for(i=0; i < A.length; i++) { S4: if(min > A[i]) {

S5: min = A[i]; } S6: }

S7: return min;

S8: }

S

begin

S

1

S

2

S

3_1

S

3_2

S

4

S

3_3

S

end

S

7

S

5

i < A.length

i =0 i++

min > A.[i] min = A[i]

i < A.length

min = Interger.MAX

A flow graph example

(12)

Path testing Path testing

To ensure all independent paths through a code are tested

Coverage factors:

– Statement coverage – Branch coverage

– Multiple-condition coverage – Path coverage

– Loop coverage

Independent paths

– McCabe’s cyclomatic measurement

v(G) = e – n + p

e - Edges n - Nodes

p - no. of connected components

S

begin

S

1

S

2

S

3_1

S

3_2

S

4

S

3_3

S

end

S

7

S

5

i < A.length

i =0 i++

min > A.[i] min = A[i]

i < A.length

min = Interger.MAX

(13)

Data flow and Object

Data flow and Object - - oriented testing oriented testing

Data flow testing

– Observing the lifecycle of a particular data (variable)

Object-oriented testing

– Test the OO features like inheritance, polymorphism, binding coverage, state-based testing

(14)

Issues & Challenges in testing software components Issues & Challenges in testing software components

Components developed in a context and deployed in another context

More expensive to fix the faults, after component delivery

Identifying the possible external and internal scenarios for a software component

Applying strict test adequacy criteria

(15)

Systematic procedure for white

Systematic procedure for white - - box testing of box testing of software components

software components

(16)

Is white

Is white - - box testing ignored? box testing ignored?

White-box testing requires high expenses in terms of time and resources

Test code is greater than the development code

Developers are confident on their code

Developers tends to overlook their faults, during unit testing

Sometimes white-box testing is done for the sake of organizational process

Criticism causes quarrel among the team members

(17)

White

White - - box testing tools box testing tools

Wide variety of white-box testing tools are available

Testing Framework

– JUnit, NUnit,…

Test case generation tools

– JTest, TBrun,…

Test coverage tools

– Clover, Cobertura,…

(18)

Does coverage is enough?

Does coverage is enough?

Objects and variables may be in many states

Presence of conditionals creates multiple paths of execution

Does not validates the implementation behavior (logic)

(19)

Shrinking the development time Shrinking the development time

Modern IDEs and Tools shrinks the development time

Most of the development time wasted in regression errors

Late detection of regression error costs more

– more code changes had happened – developer forgot the context

– developer spend more time in building new code on top of faulty code

(20)

Continuous testing Continuous testing

Idea of continuous testing

[9]

, uses real-time integration with the development environment to asynchronously run tests

Achieved by constructing safe asynchronous model – test execution is done on current code version and feedback is provided to the developer

Resembles to TOTE (Test-Operate-Test-Exit) model of cognitive behavior

Continuous testing reduces wasted time by 92-98%, over other approaches

Running Test Suite

Add/Modify Code

Successful Test Run

Test Operate Exit

Continuous Testing (TOTE model)

[9] David Saff, Michael D. Ernst, “Reducing wasted development time via continuous testing”

(21)

Who watches the watchman?

Who watches the watchman?

Any form of observation is also an interaction, that the act of testing can also affect that which is being tested

Members of the "context-driven" school of testing believe that there are no "best practices" of testing

Good software testing is a challenging intellectual process

(22)

Re Re - - test model for white test model for white - - box testing box testing

Problems

– Identify the component's change and analyze their impacts to its component test suite

– A cost-effective method for test suite updates and maintenance

Solution: Re-test model

– To identify the relationships between components at unit level – To identify the reusable test cases and to define re-test criteria

– Facilitate automatic test generation and adaptation to the modified component

Component Function Access Graph (CFAG) model

[10]

– view depicting the dependency and data flow among the functions within a component

Dynamic-CFAG

[11]

– dynamic view of the function invocation by a test case

[10] Jerry Gao, Raquel Espinoza, Jingsha He, "Testing Coverage Analysis for Software Component Validation“

[11] J. Gao, D. Gopinathan, Quan Mai, Jingsha He, “A Systematic Regression Testing Method and Tool For Software Components”

(23)

Mapping of test cases to development code Mapping of test cases to development code

Mapping of test cases to development code at statement level helps:

– to have an effective white-box testing activities

– to identify the regression test suite (especially for continuous testing) – to study the test suite impact analysis

– prioritizing the test cases

Test cases mapping to development code.

Depicts the mapping of test set to module level and test case at

statement level

(24)

Conclusions Conclusions

White-box testing contributes the major effort towards the component quality assurance

IDEs and Tools should assist the developer to form a quality test suite for an effective white-box testing

To develop a tool which will aid the developer to perform an

efficient white-box testing process by collaborating with the

existing tools and utilizing the discussed concepts

(25)

References References

[1] Heineman, G. T., and W. T. Councill, (eds.), “Component-Based Software Engineering:

Putting the Pieces Together”, Reading, MA:Addison-Wesley, 2001.

[2] Jerry Zeyu Gao, H.S. Jacob Taso, Ye Wu – “Testing And Quality Assurance For Component Based Software”,Artech House Boston, 2003.

[3] Gao, J., “Challenges and Problems in Testing Software Components”, Proc. of

ICSE2000's 3rd International Workshop on Component-Based Software Engineering:

Reflects and Practice, Limerick, Ireland, June 2000.

[4] Stocks, P. A., and Carrington, D. A, “A Framework for Specification-Based Testing”, IEEE Transaction on Software Engineering, Vol. 22 (11), IEEE Computer Society Press (1996), 777-794.

[5] Wang, Yingxu, King, Graham, and Wickburg, Hakan, “A Method for Built-in Tests in

Component-based Software Maintenance”, Proceedings of the 3rd European Conference on Software Maintenance and Reengineering, (1998).

[6] Gao, J., et al., “On Building Testable Software Components”, Proc. of 1st International Conference on Cost-Based Software System, 2002, pp. 108-121.

(26)

References References

[7] McCabe, T., “A Complexity Measure”, IEEE Transactions on Software Engineering, December 1976.

[8] http://www.testingfaqs.org/t-unit.html - Unit Testing Tools

[9] David Saff, Michael D. Ernst, “Reducing wasted development time via continuous testing”.

In 14th International Symposium on Software Reliability Engineering, pages 281 - 292, 2003

[10] Jerry Gao, Raquel Espinoza, Jingsha He, "Testing Coverage Analysis for Software Component Validation". In Proceedings of the 29th Annual International Computer Software and Applications Conference (COMPSAC’05), 2005

[11] J. Gao, D. Gopinathan, Quan Mai, Jingsha He, “A Systematic Regression Testing

Method and Tool For Software Components”. In Proceedings of 30th Annual International on Computer Software and Applications Conference, Volume 1, pages 455 - 466. IEEE Computer Society, September 2006.

References

Related documents

In the present investigation, the Bartlett’s χ 2 − test has been used for testing the homogeneity of error variances when the distribution of errors is normal and Levene test

The results show that the failure time at each current stress level has passed K-S test successfully, which verifies that WOLED life follows lognormal

Testing of Hypothesis: Test of Significance, Chi-square test, t-test, ANOVA, F-test...

of the programs. 172 7.8 Average percentage of affected nodes versus affected test cases. 173 7.9 Crosscutting change analysis. 173 7.10 Box-plot of the percentage of faults detected

This is to certify that the work in this thesis entitled “Design, Fabrication and Testing Of Shaft-alignment test set up” by Amit Kumar Pradhani, has been carried

The following figure gives a overview of how we would proceed with the input program and after getting the transformed program we have to check its increase through a coverage

In this approach,shown in Figure 5.1, first develop the simulink model in Matlab that generates the .mdl file. Next we have to perform forward and backward slicing,.. for

We have generated test sequence from control flow graph using this tool which can be useful for finding data anomalies in JSP pages... List