1. What is the difference between locking and non-locking when talking about version control?
Locking only allows one person to check out a file and work on it. Non-locking allows multiple developers to check out the same file and make changes.
2. Name one advantage of non-locking over locking.
The problem of a user taking out a lock and forgetting to return the file by unlocking it is eliminated.
3. What is the difference between white box and black box testing?
In white box testing, a tester uses an internal perspective of a system to develop test cases based on the internal structure. In black box testing, a tester only has an external perspective of a system and chooses valid/invalid inputs and ensures the correct output is returned.
4. What is the difference between the Codeline policy of an Active Development Line and a Release Line?
For an Active Development Line, progress is slightly favored over stability. For a Release Line, stability is favored over progress.
5. List two distribution terms that Open Source software must comply with. Provide a brief explanation of each.
Free Redistribution - The license shall not restrict any party from selling or giving away the software as a component of an aggregate software distribution containing programs from several different sources. The license shall not require a royalty or other fee for such sale.
Derived Works - The license must allow modifications and derived works, and must allow them to be distributed under the same terms as the license of the original software.
6. Explain one reason that Open Source software has been successful and popular with developers.
Community - Having a common source code pool and the tools provided by the Internet creates an opportunity for extensive and speedy collaboration on development projects.
7. What is wrong with the following statement?
import java.util.*;
Using the “*” in an import statement is a violation of coding standards. You should explicitly import each class that you use from other packages because it is an important form of documentation for those reading your code.
8. List at least two things you should do before asking a technical question by email, newsgroup, or website chat board.
1) Try to find an answer by searching the Web.
2) Try to find an answer by reading the manual.
9. Does a high percentage in a coverage report ensure the quality of your code? Explain your answer.
No, a high percentage in a coverage report can expose code that has not been adequately tested, but it cannot guarantee the quality of your code. You need to ensure that your tests are thorough and adequate enough to ensure the quality of your code.
10. Why is it important to get developer buy-in when implementing coding standards?
It is important to get developers to buy-in when implementing coding standards so they understand the importance of the standards and are more likely to follow them. Providing the reasoning behind each rule can encourage adoption of the rules.
Sunday, October 18, 2009
Thursday, October 15, 2009
Collaboration through SVN
Subversion or SVN is a version control system that is used when there are multiple developers that may be working on a project at the same time. This software ensures that everyone is working on the latest version of the project. Also, SVN is very useful when multiple developers are working on the same project because it can ensure that different developer's changes don't overwrite each other. SVN is non-locking which means that two developers can work on the same files at the same time. The files are checked for conflicts when they are committed. If any conflicts occur, the developer who is trying to commit is notified that they must update their files and resolve any conflicts before committing.
I was able to host my Robocode project on Google Project Hosting and create a discussion group for it. I found that setting up the automatic commit and issue messages to be difficult. At first, I could not get automatic commit and issue messages to be sent when changes were made to the project files. I added the group email address for the discussion site, robocode-kkc-diamondbot-discuss@googlegroups.com, to receive activity notifications. I finally got it to work after setting robocode-kkc-diamondbot@googlecode.com to be the sender.
I learned that using Google Project Hosting and SVN is a good way that multiple developers can collaborate on a project. It is vital to have version control when working with multiple developers to ensure that progress keeps moving forward. Attempting to accomplish this manually would be an extremely tedious and time comsuming task. Thankfully, there is version control software like SVN that can automate the process.
I was able to host my Robocode project on Google Project Hosting and create a discussion group for it. I found that setting up the automatic commit and issue messages to be difficult. At first, I could not get automatic commit and issue messages to be sent when changes were made to the project files. I added the group email address for the discussion site, robocode-kkc-diamondbot-discuss@googlegroups.com, to receive activity notifications. I finally got it to work after setting robocode-kkc-diamondbot@googlecode.com to be the sender.
I learned that using Google Project Hosting and SVN is a good way that multiple developers can collaborate on a project. It is vital to have version control when working with multiple developers to ensure that progress keeps moving forward. Attempting to accomplish this manually would be an extremely tedious and time comsuming task. Thankfully, there is version control software like SVN that can automate the process.
Monday, October 5, 2009
Passing the Test
Automated testing is an efficient way to ensure that as you develop a program it still works correctly and as expected. This approach is much more time efficient than entering test cases manually. As you add new functions to your program, it is important to ensure previous capabilities are not affected. JUnit is an automated Java testing program that allows a developer to create custom tests to verify functionality and performance.
As I developed my Robocode robot, it was important to ensure that changes I made while adding new features did not result in a loss of previous performance. I could have manually run Robocode each time I made a change, however, this approach is time consuming and takes away effort that should be put towards improving my robot's performance. JUnit allowed me to create tests that could be run in a fraction of the time it would take me to accomplish manually.
The three types of JUnit tests that were created that were acceptance, behavioral, and unit tests. Acceptance tests verify that a robot can consistently defeat another robot. Behavioral tests check that a robot correctly implements a movement, firing, or targeting strategy. Unit tests verify that individual methods correctly calculate an output for specified inputs. These tests can provide a developer a reasonable performance measurement. While this does not test for all situations, it can cover a substantial portion of your code to ensure that it is working as expected.
The simplest tests to create were the acceptance tests where a robot is matched against another robot to verify that it can consistently defeat it. I chose to battle my robot against RamFire and Crazy and check that it was able to win more than fifty percent of the time. The behavioral test was more difficult to create. There was much more information that was required to be gathered to validate that a strategy was being implemented. I decided to test my movement strategy. I ran into problems getting my behavioral tests to work correctly. Eventually, I was able to get this test to work. The unit tests that were created verified the output of three methods. One calculated a distance that was required, another calculated an angle, and the last calulated how many degrees the robot needed to be turned to face the next position.
Now that I have some experience in writing JUnit tests, I would develop my robot to have smaller methods. I found that I was doing too much in one method, which made it difficult to write tests for. I had to break down my methods without altering the behavior of my robot to be more specific to accommodate testing. After modifying my robot, determining how to perform unit tests became much simpler.
I felt that these tests adequately tested my robot since the program was rather short. If this had been a larger project, I would have had to write more tests in order to increase the coverage provided by the tests. Listed below are the results from running Emma.
Overall coverage Summary:
Class Percentage = 89%
Method Percentage = 80%
Block Percentage = 55%
Line Percentage = 56%
Even though I ran into some issues while developing my tests, I was able to see the value in creating automated tests. After the tests were created, I was able to run them over and over without much time and effort. The ability to create automated tests is an essential skill to have and is particularly valuable when developing a large project.
A distribution of my robot including JUnit tests can be found here.
As I developed my Robocode robot, it was important to ensure that changes I made while adding new features did not result in a loss of previous performance. I could have manually run Robocode each time I made a change, however, this approach is time consuming and takes away effort that should be put towards improving my robot's performance. JUnit allowed me to create tests that could be run in a fraction of the time it would take me to accomplish manually.
The three types of JUnit tests that were created that were acceptance, behavioral, and unit tests. Acceptance tests verify that a robot can consistently defeat another robot. Behavioral tests check that a robot correctly implements a movement, firing, or targeting strategy. Unit tests verify that individual methods correctly calculate an output for specified inputs. These tests can provide a developer a reasonable performance measurement. While this does not test for all situations, it can cover a substantial portion of your code to ensure that it is working as expected.
The simplest tests to create were the acceptance tests where a robot is matched against another robot to verify that it can consistently defeat it. I chose to battle my robot against RamFire and Crazy and check that it was able to win more than fifty percent of the time. The behavioral test was more difficult to create. There was much more information that was required to be gathered to validate that a strategy was being implemented. I decided to test my movement strategy. I ran into problems getting my behavioral tests to work correctly. Eventually, I was able to get this test to work. The unit tests that were created verified the output of three methods. One calculated a distance that was required, another calculated an angle, and the last calulated how many degrees the robot needed to be turned to face the next position.
Now that I have some experience in writing JUnit tests, I would develop my robot to have smaller methods. I found that I was doing too much in one method, which made it difficult to write tests for. I had to break down my methods without altering the behavior of my robot to be more specific to accommodate testing. After modifying my robot, determining how to perform unit tests became much simpler.
I felt that these tests adequately tested my robot since the program was rather short. If this had been a larger project, I would have had to write more tests in order to increase the coverage provided by the tests. Listed below are the results from running Emma.
Overall coverage Summary:
Class Percentage = 89%
Method Percentage = 80%
Block Percentage = 55%
Line Percentage = 56%
Even though I ran into some issues while developing my tests, I was able to see the value in creating automated tests. After the tests were created, I was able to run them over and over without much time and effort. The ability to create automated tests is an essential skill to have and is particularly valuable when developing a large project.
A distribution of my robot including JUnit tests can be found here.
Subscribe to:
Posts (Atom)