"provide a program solution to the Lowest Common Ancestor problem" "As outlined in lecture 4, the task I have set you is to provide a program solution to the Lowest Common Ancestor problem. You are to implement a solution to the basic problem. You may assume that the graph is structured as a "binary tree" (as you explore the problem, you may find that this simplification helps you reach a solution). You will find a great deal of sample code on how to solve this problem. Feel free to source and use this material - a software engineer cares about the quality of his solution, rather than the provenance of his code. However, it is not enough simply to find and hack together a solution and submit it to me. My interest (and grading approach) is in how you build and validate your solution. I showed you how to perform unit testing and integrate this into your development approach in lecture 4. This is now your opportunity to follow this model. Accordingly, you will be graded based on your adherence to the following procedure:
Choose a unit testing framework. A comprehensive by language list is available here.
Create a repository on a git service such as Github. Your work will be implemented in this repository.
Define a set of initial unit tests that capture the basic expected behaviour. This will require you to create sample data and also to identify the basic API for your solution.
Build your initial solution, testing it against your test code until it is working.
Refine the solution, expanding your test cases to deal with awkward parameters and edge cases that push the limits of your solution, enhancing your solution to deal with these.
An obvious question will probably arise for you in reading this: how do I know that I have written sufficient test code? Well, that's for you to decide. You are done, when you believe no parameter set passed to your code could break it in a way that your test code does not already capture. You will be assesed based on a concept known as code coverage.