From 14f2d33c638acdc61a0c561fdbc7ae5fcd3e8a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Fri, 17 Jun 2005 11:57:17 +0000 Subject: [PATCH] * unittests more important than suggestions --- src/CODING | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/CODING b/src/CODING index 34c5ab49..7f29caf3 100644 --- a/src/CODING +++ b/src/CODING @@ -9,9 +9,32 @@ Guidelines in pisiconfig 2. Python indentation is usually 4 chars. 3. Follow python philosophy of 'batteries included' +4. Don't make the code have runtime dependencies on + a particular distribution (as much as possible) + +Unittests +--------- + +Unittests are located in unittests directory. Running the tests are +trivial. But you must syncronize your code and data with the test +code, which can be a tedious work if you lose discipline. + +Sample data files are located in samples/ directory. + +For running all test suites, use the following command: + +$ ./unittests/run.py + +If you know what you are doing, you can run the tests seperately. But +keep in your mind that test can depend each other. The following +command will run tests in specfiletests and archivetests: + +$ ./unittests/run.py specfiletests archivetests + + +Misc. Suggestions +----------------- -Suggestions ------------- In OO programming, try to invoke Demeter's law. One of the "rules" there is not directly accessing any objects that are further than, 2/3 refs, away. So the @@ -43,22 +66,3 @@ The main rule of thumb in Demeter's Law is avoiding putting more than, say, 10 methods in a class. That works really well in practice, forcing refactoring every now and then. - -Unittests ---------- -Unittests are located in unittests directory. Running the tests are -trivial. But you must syncronize your code and data with the test -code, which can be a tedious work if you lose discipline. - -Sample data files are located in samples/ directory. - -For running all test suites, use the following command: - -$ ./unittests/run.py - -If you know what you are doing, you can run the tests seperately. But -keep in your mind that test can depend each other. The following -command will run tests in specfiletests and archivetests: - -$ ./unittests/run.py specfiletests archivetests -