Lowest-Common-Ancestor

A python program and unit tests environment that gets the lowest common ancestor for a graph for CSU33012 software engineering module.

Master Branch

Final merged solution

BinaryTree Branch

The initial LCA solution

DAG Branch

Enhanced LCA solution

Biography Branch

George Hotz - An Influential Software Engineer

Requirements

python pytest pytest-cov

Optional

Alternatively you can run the complete development environment based on the included Dockerfile, in which case you will need to have docker installed and configured for your machine.

docker

Testing

Pytest is used to run unit tests. Pytests coverage plugin is used to check code coverage, as shown below.

Screenshot

Using the coverage html command will generate a html code coverage report, which can be viewed in a browser.

Docker

For ease of development and testing I have included a Dockerfile, from which you can build a docker image that includes all the necessary dependencies.

After cloning the repo and navigating to the Lowest-Common-Ancestor root directory, build the docker image using the command:

docker build -t python_dev . this builds a docker image with the tag python_dev from the included dockerfile.

Once this is completed successfully you can run the container using the command: docker run -i -t --name python python_dev This will create an interactive container called python from the python_dev image we just made.

After running the container you should be greeted with a bash shell and instructions on how to run tests and check for code coverage.

Docker