Sunday, October 18, 2009

Midterm Questions

Q. Explain how it is or how it is not possible for an individual like yourself to make money from FOSS (Free Open Source Software).

A. It is not only possible but many people are doing this now. We can think of two likely situations of this. First, is that a developer can be hired by a company to work on code to add features or modifications to meet the requirements of the company. Second, companies like IBM and RedHat pay their employees to improve software like the Linux Kernel so it can improve the companies service offerings.

Q. Why are comments and documentation so important in the success of your project?

A. Not putting comments or documentation will typically result in a failure of your project by going directly against what the second and third prime directives state. The first prime directive will also fail because if the user and developers can’t work on the code easily, then the system will not meet the functionality that was initially stated.

Q. Implement the foreach construct in a main method and give an example of class signature that is required for the use of iterating over that collection. The iterable type is arbitrary.

A.
class FibonacciSequence implements Iterable {
...

public Iterator iterator() {
return new FibonacciIterator();
}

public static void main(String argv[]) {
FibonacciSequence fib = new FibonacciSequence();

for (BigInteger i : fib)
System.out.println(i);
}

Q. Give an example of unitasking. Think creatively.

A. An example of unitasking would be if you had many things to do and you are able to organize those tasks into one specific task to accomplish them all. For example, if you have many classes to write, you could make a super class in order to save time from repetitive tasks.

Q. What are some benefits of Static Analysis and Dynamic Analysis, list tools used to perform these automatically and explain how the two types differ.

A. Static analysis can find bugs in binary, byte code or source files that may not be executed during dynamic analysis. Dynamic analysis, having to run the code, will only find bugs that are executed.
PMD, FindBugs and Checkstyle are all static analysis tools.
JUnit is dynamic analysis.

Q. Why is it a good idea to make sure the version of a required dependency that Ant retrieves is correct?

A. It is very important that all users be using the same dependancies in order to limit the scope of variables that could be causing bugs within a given package. If all packages are the same and many users report the same problem, it is that much easier to figure out the problem.

Q. Explain the importance of regression testing and its role in large systems.

A. Regression testing is essential if you do not want to have spaghetti code that is littered with bugs. Regression testing is especially useful when dealing with large systems because when many people are working on the same code, bugs can be introduced at anytime. Doing regression tests every build can prevent conflicting behavior introduced into the code during nightly builds.

Q. Give two scenarios where white box testing is beneficial and where blackbox testing is beneficial.

A. White box testing can be more detailed in its findings if it is done correctly all the down to the unit level. The problem with this is that white box test may not test for the right things or integrate with the system well. White box testing should be employed in a fashion that exhibits well thought out and reckless behavior in order to break the system.
Black box testing should be performed to see if all the components fit together or in a situation where you want to feed arbitrary data into a complete running system to see how it behaves. The system should be tested with a fuzzer in order to find bugs in software that does not handle the input correctly due to improper validation.

Q. Give some problems that version control set out to address.

A.
The double maintenance problem (having multiple copies to maintain)

The shared data problem (multiple developers need to access one file at same time)

The simultaneous update problem (a way to prevent one file by being updated at same time by multiple parties).

Q. Why is Git so beneficial for large open source projects?

A. Git allows everyone to work faster and have copies of the whole repository, instead of relying on bandwidth from a centralized location. Having the complete history one command away is power to the developer.

0 comments:

Post a Comment