Sunday, October 18, 2009

Turning Knowledge Into Questions (Update)

When reading to understand, it takes a while before the full concept is realized. You must first do the initial reading, taking a moment or two at difficult points, digest the material, then review. The real test to see if one fully understands the material is if he/she can create questions based on the reading that isn't easily found just by skimming.

This is just the case for this week's assignment for my Software Engineering class. This blog post contains 10 quiz style questions that will help me and fellow classmates study for the upcoming midterm. Each student will come up with their own questions and by the end of the assignment, we will have a diverse array of questions to study from.

Topics range from the initial FizzBuzz program, multi-tasking, Java concepts, Build technology, testing, Ant, and Configuration Management.

I will amend this post with the answers later on this week.
Answers are here!

Here goes:

FizzBuzz + Anti-Patterns
1) How would you test the correctness of the FizzBuzz program?
A: You essentially want to create a unit test that tests the boundaries and the conditions that print "Fizz", "Buzz", and "FizzBuzz", namely 1, 3, 5, 15, and 100.

2) What would be a Happy-path test for the FizzBuzz program?
A: Happy-path test would be creating a single unit test that would always test a single value, let's say 1, and always return 1, causing the test to always pass.

Three Prime Directives
3) How do the Ant .xml files in the robocode-pmj-dacruzer system satisfy the Three Prime Directives?
A: The build files included allow for automated quality assurance/distribution which is a very useful tool to alleviate the tediousness of importing foreign projects. The fact that it's coded in Ant and automatically downloads necessary libraries it needs to successfully "build" a system ensures that an external user can install and use. The .xml files are direct source code which users edit, and there's also the online API for Ant.

Coding Standards
4) You created the ultimate Robocode robot that can beat any opponent, why would ensuring your code be up to standards be necessary?
A: The ability to beat another robot does not ensure readability or the ability for another user to adapt code. When you need to isolate a specific portion of code to test, have you're code could be a mess and probably would have to re-structure you're code in order to do so.

Quality Assurance
5) Your code has passed automated tests Checkstyle, PMD, FindBugs, why are automated tests not enough to ensure quality code?
A: These sorts of tests are only ensure that you're program follows standards and runs. It in no way can test the validity/correctness of your program. You will need to create an array of tests to accomplish this.

Asking Questions, Getting Answers
6) You're having trouble getting your JUnit tests for Robocode to work in Eclipse. You keep getting the error "robocode.jar not found." Given this problem, write a question in good form, you may make-up any other specific details that will aid in the diagnosis of the problem.
A: Hello, I've been trying to get my unit tests for a Robocode project to work in Eclipse, but I keep getting the error "robocode.jar not found." I've tried searching the forums to see if anyone else has this problem, but so far no one has. I'm sure I've setup my VM-arguments correctly (-Drobocode.home=) when I "Run As". I'll greatly appreciate any help/insight. Thank you for your time.

Understanding Ant Code
7) Given the following Ant code from checkstyle.build.xml:



What does it do?
A: Creates a target for checking if "checkstyle" has already been installed, if "checkstyle.config.available" does not exist, then Ant will download the necessary files from "src" url into the "dest" fo
lder giving it a timestamp.

8) Write a simple Ant statement that checks if the file robocode.jar is available in the path ${robocode.pat
h} and give it the property robocode.available.
A:


Version Control
9) Given an example where pessimistic locking is preferred, then give another example where optimistic locking is best. What does this tell you about which Version Control System to use?
A: Pessimistic locking only allows a single person to checkout a file, and places a lock while until it's been checked back in. Optimistic locking allows for multiple check outs and only places a lock when a person check's it back in with updates. On web based project or a large development team, you would want simultaneous check outs to facilitate work, so Subversion might be the right tool to use. However, if strict updates need to be kept, and you're in a small team of maybe 2/3, pessimistic might be feasible, so Revision Control System (RCS).

Open Source
10) What's the different between Free Software and Open Source Software?
A: Free software doesn't need to make its source code available and modifying and distributing the program is not necessarily allowed. Open Source software makes it source code available and modifying and distrubting the software is allowed.

How did y'all do? ^o^

No comments:

Post a Comment