-
Notifications
You must be signed in to change notification settings - Fork 0
drichards/BlackboxTester
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Team members:
Michael Thompson - thompson.mi@husky.neu.edu
Victor Jiang - jiang.v@husky.neu.edu
David Richards - dirich@ccs.neu.edu
Seth Tringale - stringale@gmail.com
To compile:
javac -d bin -cp assets/junit-4.10.jar -sourcepath src src/*/*.java
To run:
./cs4500 file1 file2
where
file1 is the name of an existing file that contains
textual input in the syntax specified below. This file
is a plain text (UTF-8) file that specifies an abstract data type
using the syntax shown below.
file2 is the name of a file to be created by the software (UTF-8 encoding);
when the program terminates, that file will contain the
source code for an R6RS top-level program that imports the
libraries to be tested, performs black-box testing of those
libraries, and outputs test results as specified below.
To compile tests:
javac -d bin -cp assets/junit-4.10.jar -sourcepath src src/blackboxTester/tests/*.java
To run tests:
java -cp bin:assets/junit-4.10.jar org.junit.runner.JUnitCore blackboxTester.tests.AllTests
Notes:
Non-deterministic checking has been implemented, so any non-deterministic
expression will not be tested by the output test program.
The following terminals are reserved identifiers and therefore should
not be used in the input specification:
"Signatures:", "Equations:", "ADT:", ":", "->", "*", "int",
"boolean", "character", "string", "=", "+", "-", "<", and ">"
Javadocs are located in the docs folder at the root of this project.
Software used:
JavaCC was used to generate the parser generator for
this project. The license for JavaCC can be found at
generator/javacc-5.0/LICENSE
More info on JavaCC can be found at http://javacc.java.net
JUnit is used for testing purposes.
More info can be found at http://www.junit.org
Source Layout:
The main program is run from blackboxTester.BlackboxTester. That
calls into the following modules.
blackboxTester.parser.Parser
This is the main class for the parser. It parses the input
using the generated classes in blackboxTester.parser.generated.*.
The returned code is an abstract syntax tree modeled by
blackboxTester.parser.ast.*;
blackboxTester.ast.generator.ASTGenerator
This takes the parsed signatures and generates a series of
abstract syntax trees that follow the signatures. They are
created using the objects in blackboxTester.ast.*
blackboxTester.ast.Evaluate
This contains the function "replace" which rewrites ASTs
and throws out any that aren't applicable to testing (along with other
helper functions). It is called in main method of BlackboxTester.
blackboxTester.outputGeneration.OutputGenerator
This handles taking fully reduced ASTs and creating a scheme
blackbox tester that will test the given algebraic specification.
Input syntax:
The names of nonterminal symbols are enclosed within angle brackets.
The <empty> nonterminal stands for the empty sequence of grammar symbols.
All terminal symbols are enclosed within double quotes; the double quotes
are not themselves part of the terminal symbol.
<input> ::= "Signatures:" <signatures> "Equations:" <equations>
<signatures> ::= <signature>
| <signature> <signatures>
<signature> ::= "ADT:" <typename> <operationSpecs>
<typename> ::= <identifier>
<operationSpecs> ::= <operationSpec>
| <operationSpec> <operationSpecs>
<operationSpec> ::= <operation> ":" "->" <type>
| <operation> ":" <argTypes> "->" <type>
<operation> ::= <identifier>
<argTypes> ::= <type>
| <type> "*" <argTypes>
<type> ::= "int"
| "boolean"
| "character"
| "string"
| <typename>
<equations> ::= <empty>
| <equation> <equations>
<equation> ::= <term> "=" <rhs>
<term> ::= <identifier>
| "(" <operation> <args> ")"
<args> ::= <empty>
| <term> <args>
<rhs> ::= "#t" | "#f"
| <uinteger 10>
| <identifier>
| "(" <operation> <rhsArgs> ")"
| "(" <primitive> <rhsArgs> ")"
<rhsArgs> ::= <empty>
| <rhs> <rhsArgs>
<primitive> ::= "not"
| "+" | "-" | "*"
| "=" | "<" | ">"
Input Syntax Notes:
The syntaxes of the <identifier> and <uinteger 10> nonterminals
are specified by R6RS 4.2.1.
Every <typename> that's used as a <type> must be declared
as a <typename> by a <signature>.
Every <operation> that's used in a <term> must be declared
as an <operation> by an <operationSpec>.
Every <identifier> that appears on the right hand side of
an <equation> must appear on the left hand side of that
<equation>.
No <identifier> may appear more than once on the left hand
side of an <equation>.
Except for parentheses, which are themselves delimiters, all
terminals should be delimited by whitespace or parentheses or
the beginning or end of the input file. (In other words,
every pair of adjacent terminals should be separated by
whitespace unless one of them is a parenthesis.)
About
A blackbox tester generator
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published