Code Monkey home page Code Monkey logo

se-q3-benchmarking's Introduction

Benchmarking (aka "I don't have time for this")

Imagine that you've been working on this program on a team of developers. You've done all the right things up until now, including writing unittests.

Unfortunately, a previous teammate not only committed code that made the benchmarking tests fail, but they force-pushed to master after rewriting the git history, so you can't simply go back in the history to fix things. Especially since, in the process of ruining the timings, the developer did manage to implement features that weren't there before.

Your task is to modify anagrams.py such that the tests pass again. If the problem isn't obvious to you by visually examining the anagrams.py module, consider using the profiling techniques that you learned about in the lessons to pin down the problem. Using a debugger may also help you to get a handle on exactly why things are slow.

A Skipped unit test?

If you look inside test_anagrams.py, you'll notice that the test_long unit test is currently being skipped. That's because if it were to run with the current implementation of find_anagrams it would take several minutes to complete. We suggest that you try and get the test_short to pass first, then comment out the @unittest.skip line and ensure that the tests still pass.

Testing with Unittest

This assignment has separate unit tests to help you during development. The unit tests are located in the tests folder; you should not modify these. Make sure all unit tests are passing before you submit your solution. You can invoke the unit tests from the command line at the root of your project folder:

$ python -m unittest discover tests

You can also run and debug these same tests using the Test Explorer extension built in to the VSCode editor, by enabling automatic test discovery. This is a really useful tool and we highly recommend to learn it.

https://code.visualstudio.com/docs/python/testing#_test-discovery

  • Test framework is unittest
  • Test folder pattern is tests
  • Test name pattern is test*

Submitting your work

To submit your solution for grading, you will need to create a github Pull Request (PR). Refer to the PR Workflow article in your course content for details.

se-q3-benchmarking's People

Contributors

kevinwclark avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.