-
Notifications
You must be signed in to change notification settings - Fork 10
For developers
Since JCUnit is a general purpose testing framework, it must be able to test various products from a library to applications in various phases from unit testing to system testing. Therefore product domain specific features and phase specific features are not in focus of it and they should be provided outside this product, e.g., Log collection mechanism, which will be useful for system testing, or adapters for web applications will not be included as a part of this product.
Followings are design policies of JCUnit (0.8.x or later),
- It must be run under Java SE 8. If you need to work with older versions of Java, please use 0.7.x.
- No external libraries unless carefully designed and explicitly stated. Its dependencies on external libraries are only
combinatoradix, a very small and predictable library to enumerate permutations and combinations, andJUnititself as of now. - When a checked exception is caught by
JCUnit's code and thrown to upper levels, it should be wrapped with aJCUnitException, which is extendingRuntimeException, or its subclasses.
And the author of JCUnit considers following items are important to use it in practice.
- JCUnit must run test cases in a test suite it generates in a fixed order always to let the user be sure if a defect he/she finds is reproducible one or it's a one that happens from time to time.
- Try to generate manageable size of test suite. (But the author does not try hard to generate the smallest one in the world. There are already so many fine products/algorithms like PICT that do it.)
- Avoid using raw-type collections.
- Use
LinkedHashMapwhen we need key-value mapping unless it is very clear that it's safe -
Lists are preferred to arrays.
- Popular styles, coding such as 'fluent' object building,
StringUtils.join, etc, are preferred. But we cannot use popular libraries such as apache-commons or google guava for reasons above. When we need to implement similar things, they will be written in classes namedXyzUtils. - Instead of
Preconditoins.checkXyz, useChecks.checkxyz.
Copyright 2013 Hiroshi Ukai.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.