Friday September 22, 2006 | cn=Directory Manager All about Directory Server |
Improving Test Coverage in OpenDSFor the last few weeks (and still for the next couple of weeks), we're in a push to improve our test coverage for the OpenDS project. This means that we're not adding lots of new features at the same rate we had been before this push (although there are still some that are sneaking through), but it will help us to ensure that when we get back to developing new features that we've got a good test framework in place to help us catch any problems that might come up.Two of the main tools that we're using to help us with our testing are TestNG and EMMA. TestNG is similar to JUnit, but offers additional features like the ability to define test groups, and the ability to use annotations to mark your classes and methods accordingly (I do know that JUnit has recently released a new version with some of these features, but I haven't evaluated them to see how the two stack up now). I really like the @DataProvider annotation, which makes it possible to separate your test data from the test logic, but since it treats each run with a different data element as a separate test case it does seem to inflate the number of test cases (for example, TestNG reports that we're running over 10,700 test cases, but we only have about 950 test methods). Probably my biggest complaint with TestNG at the moment is that it doesn't have an assertNotEquals method (which is easy to work around but annoying nonetheless), so I guess that says something about the framework. I also hate like the use of JavaScript in the HTML-formatted reports that it generates and on the TestNG website, but that's another matter altogether. EMMA is a tool that makes it possible to provide code coverage analysis for Java applications. It will allow you to see what code is being called, and is especially useful in testing because it helps you see what still needs to be tested. It allows you to browse all of your source code so that you can see lines in green, yellow, and red (covered, partially covered, and not covered, respectively). It's annoying that the source code display uses a variable-width font rather than one that is fixed-width, but again that's a pretty minor grievance. I also don't really care for the way that it generates the report layout using filenames that change between runs (e.g., clicking refresh after re-running coverage tests might show me a different class), but that's also easy to work around. We're currently up to about 41% code coverage, which I will grant you isn't as high as it should be (writing test cases was a step that we skipped early on in the project to help us get the basic framework up and running as quickly as possible), but it is rising pretty quickly since we were at only 12% a month ago. There are still big chunks of code (especially corner cases) that aren't covered, but in general things are looking pretty good. I am, however, very much looking forward to getting back to adding features once our coverage gets up where it needs to be, and in the future we will be ensuring that we provide adequate test coverage as we write the code so we don't fall behind again. Posted by cn_equals_directory_manager ( Sep 22 2006, 05:52:34 PM CDT ) Permalink Why Run the Directory Server on Solaris?Yesterday, someone asked why Solaris was the best platform on which to run Directory Server. While I may be a bit biased, I do believe this to be the case and feel that there is plenty of evidence to support it. This is true across the board. I'll try to list many of those benefits here, and also to avoid bashing or picking on any of the other operating systems that are available for use. Many of the other operating systems are quite capable and in some areas are able to meet or even exceed the corresponding offering from Solaris, but I don't think that any of them come close to providing the complete package.General Platform Benefits
Performance and Scalability Benefits
Security Benefits
Debugging Benefits
Posted by cn_equals_directory_manager ( Sep 08 2006, 05:58:14 PM CDT ) Permalink OpenDS Weekly BuildsAs a developer, I find OpenDS very easy to check out and build. However, the process of checking out the code does require you have some way of accessing our Subversion repository. The process for doing this is documented in the OpenDS Source Guide available at https://opends.dev.java.net/public/docs/index.html, but we do realize that not everyone wants to worry about checking out and building the code. To make it easy to get for people that just want to take a look at the current state of the server, we upload a pre-built version once a week (typically on Friday -- I just uploaded build 006 a few minutes ago) based on the latest version of the code. You can access our weekly builds here. To give it a spin, just follow these steps:
At this point, the server should be running and you can try talking to it with a tool like bin/ldapsearch.sh or bin/ldapmodify.sh. Note that you need to have Java SE 5 or later (it works fine with recent Java SE 6 and Java SE 7 builds as well) installed on your system. On Windows (and potentially on UNIX-based systems if the java executable isn't in the PATH) then you may need to set the JAVA_HOME environment variable to point to the directory in which Java is installed.
When we upload a weekly build, we also send a message to the builds@opends.dev.java.net mailing list, and that message includes information about some of the biggest changes included in that build. If you want to keep up on these things, you can either join the mailing list or just look through the archive every once in a while. The message that we used for this week's build is provided below:
I have just uploaded OpenDS 0.1 Build 006, built from revision 262 of our source tree, to our weekly builds folder. The direct link to download this file is: https://opends.dev.java.net/files/documents/4926/39978/OpenDS-0.1-build006.zip Notable changes that have been integrated since build 005 include: Revision 211 (Issue #603) -- Add a mechanism that may be used to determine the operating system on which the server is running. It includes code to try and identify the following operating systems: AIX, FreeBSD, HP-UX, Linux, Mac OS X, Solaris, Windows, and z/OS. We may be able to use this information to tailor the operation of the server to the underlying platform in certain cases. Revision 227 (Issue #601) -- Provide a mechanism for setting file permissions. On UNIX-based systems, we will attempt to use the chmod command if possible, which will work properly on both Java 5 and Java 6 and will also provide the greatest flexibility. On other systems, if the server is running with Java 6 then it will attempt to use the new methods added to the java.io.File class. Revision 230 (Issue #588) -- Add initial MakeLDIF support, which can be used to generate entries based on a template. This is similar to the MakeLDIF tool provided with SLAMD (although it is not yet completely implemented, and there may be cases in which the two will not be 100% compatible), although this version includes better validation of the template before generating entries. Further, this capability has been directly integrated into the import utility so that it is possible to import data that is being generated on the fly rather than from an existing LDIF file. Revision 242 (Issue #614) -- Update the client-side tools to help eliminate a potential race condition that could result from the reuse of LDAP message IDs. On some systems, using the StartTLS extended operation could cause the client to reuse a message ID of an operation that was still being processed by the server, which would cause the server to reject the new request. Revision 655 (Issue #604) -- Update the synchronization code to provide initial detection and resolution for conflicts that can occur when making updates on multiple servers at the same time. Some of these conflicts include concurrent replacement of the same attribute in the same entry, modifying an entry on one server while deleting or renaming it on another, and concurrent creation of two entries with the same DN. Revision 261 (Issue #618) -- Fix a bug that could impact indexed subtree searches using subInitial filters. Posted by cn_equals_directory_manager ( Sep 01 2006, 05:48:47 PM CDT ) Permalink |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||