-
Notifications
You must be signed in to change notification settings - Fork 3
2.5.3 Test Convention
hsye185 edited this page Aug 27, 2015
·
2 revisions
Having a common convention is the key to great, readable code. Here at Team FloppyDisk, we do just that, here is a list of testing conventions and important tips and tricks to help the testing process. Please note that, it would be wise to read the section 2.5.1 Test Script before writing tests, as it will give a better understanding of how the test suite works.
- Place all unit tests within SoftEng-306-Project1/se306Project1/test/
- Place all acceptance build tests within SoftEng-306-Project1/
- Tests will have a file name of "Test_[EntityName]_[FunctionName].py" e.g. Test_Robot_goto
- Class name within Test File will have the same name as the file
- Class will inherit from unittest.TestCase and TestModule
- Each test function within the class will have the format of "test_[Description]"
- Each test file runs on a single stage, so be aware that within a file... each function will build off it's predecessor. Don't have things that will assume you're on a clean slate every function all, because you're not. A good example of what I mean is Test_Robot_face_direction.py I've used 4 tests within that file, but they are all independent. For example, if you use a move forward and assume it's always from the start position, that might be a mistake because you may have run another test within the same file that changes it's current location.
-
Initial Setup :
- add "export PYTHONPATH=$PYTHONPATH:~/SoftEng-306-Project-1" to your .bashrc file
- rosmake your s306Project1 folder
-
Run Tests:
- Open terminal at project root (~/SoftEng-306-Project1/), use command "python test.py" (use "-v" for more descriptive output)
- Starting from scratch can sometimes be daunting, I'd recommend using another test and use it as a template. It would be best to use a template similar to what you're writing for. They all have a similar theme, as is documented in the convention, but using similar code will definitely speed up the testing progress.
##1.0 Introduction
##2.0 User Manual
##2.5 Testing
3.1 Launch Infrastructure
3.2 Entities and behaviours (Robots, humans, animals)
- 3.2.1 Entity Superclass
- 3.2.1.1 Entity Movement
- 3.2.2 Robot Entity
- 3.2.2.1 Robot Entity Detection
- 3.2.2.2 Robot Path Finding
- 3.2.3 Robot Pickers
- 3.2.4 Robot Carriers
- 3.2.4.1 Carrier Queue
- 3.2.5 Humans
- 3.2.6 Animals
- 3.2.7 Entity Topics
3.3 Special services and features
##4.0 Project Planning and management
- 4.1 Project plan
- 4.2 Git Branching and Merging Etiquette
- 4.3 Design Requirements, System requirements and Technical specifications
- 4.4 Key Factors and Constraints
- 4.5 System Design
- 4.6 Time spent
- 4.7 Testing and integration overview
- 4.8 Meeting minutes
##Miscellaneous resources