net.sourceforge.groboutils.mbtf.v1

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Natural Language Processing
51.Net
52.Parser
53.PDF
54.Portal
55.Profiler
56.Project Management
57.Report
58.RSS RDF
59.Rule Engine
60.Science
61.Scripting
62.Search Engine
63.Security
64.Sevlet Container
65.Source Control
66.Swing Library
67.Template Engine
68.Test Coverage
69.Testing
70.UML
71.Web Crawler
72.Web Framework
73.Web Mail
74.Web Server
75.Web Services
76.Web Services apache cxf 2.2.6
77.Web Services AXIS2
78.Wiki Engine
79.Workflow Engines
80.XML
81.XML UI
Java Source Code / Java Documentation  » Test Coverage » GroboUtils » net.sourceforge.groboutils.mbtf.v1 
net.sourceforge.groboutils.mbtf.v1
net.sourceforge.groboutils.mbtf.v1 The Model-Based Testing Framework. Currently, the MBTF is a simple state machine engine that is able to generate cyclic paths through the various transitions presented by the state machine model, combined with a Path Parser that knows the correct procedure in iterating though a path, and executing the correct validation steps.

Implementation

Model-Based Testing allows for testing the various routes of computation though a system to ensure system integrity. Traditional testing methodologies requires the tester to calculate and manually generate these paths.

The logic goes something like this: the tester models the system in a state-machine, using a minimalistic model where possible. At each state, the tester creates validation tests to ensure the system is indeed in that state. Also, each state has an associated set of transitions; each transition has both a validation (to ensure the transition can occur), and an action which moves the current state to another state. The MBTF then takes this model and generates combinations of paths through the states. At each state, the state itself is verified, and all transitions are verified. Any error discovered causes the path to be recorded and stamped with the error for future evaluation.

Useage

A direct user of the MBTF needs to first define an implementation of ISystem. This class contains the necessary information and actions to perform state validation and transition actions for the system in question. Also, the user needs to define an ISystemFactory, which knows how to create an ISystem in the correct initial state.

I'd recommend for your particular System, creating an abstract IVerifiy implementation which allows for reducing the casting problem inherit in a generic system such as this:

    public abstract class MyVerify implements IVerify
    {
        public final void verify( ISystem ss, IErrors errors )
        {
            myVerify( (MySystem)ss, errors );
        }
        
        public abstract void myVerify( MySystem mss, IErrors errors );
    }

Then, it's a matter of defining the system's set of states and transitions.

References

Java Source File NameTypeComment
IAction.javaInterface Performs a state-transition action on the system.
IError.javaInterface Contains all information relating to when an error (or warning) was reported to IErrors.
IErrors.javaInterface A container for registering errors or warnings caused by invalid validation of a state or transition.
IErrorsUTestI.javaClass Tests the IErrors interface.
IPath.javaInterface An ordered set of transitions plus a start state, which can be iterated through to discover a state-machine transition path.
IPathGenerator.javaInterface Creates different sets of paths through the state machine.
IPathHistory.javaInterface Records the states and transition history during a path traversal. The instance can be cloned for the cases of errors and warnings needing to store the path history when they occured.
IPathIterator.javaInterface An iterator to allow the tracing of the transitions through a state machine.
IPathParser.javaInterface Knows how to parse an IPath instance, and correctly follow the transitions and record errors.
IState.javaInterface Associates a system state with the transitions leading out of the state, and with the validation of the state.
ISystem.javaInterface A marker interface to indicate the current state of the system being modeled.
ISystemFactory.javaInterface Each new path should correspondingly have a new ISystem to interact with, to ensure that the system has been properly reset.
ITransition.javaInterface Corresponds to a state-machine transition from one state to another.
IValidate.javaInterface Performs a validation on a system, to ensure that the associated item (IState or ITransition) can be processed.
TestFailRuntimeException.javaClass Generating this exception during a test will cause only the current path to halt.
TestHaltRuntimeException.javaClass Generating this exception during a test will cause all testing, current path and future paths included, to halt.
w_ww__.j__a_v__a2__s_.__c_om__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.