Coder Social home page Coder Social logo

csc212adtr's Introduction

P4: Testing ADTs

The learning objectives of this assignment are to understand how JUnit works and how to read and write basic tests before we start working on our own data structures.

Due Date: March 5, 2020.

Remember that we will have a midterm that weekend, so don't save it until the last minute!

Rubric

Rubric and Reflection (=15)

You must fill out a Google Form to indicate the parts of the assignment that you have attempted.

In addition, you will write 10 statements of either:

  • Accomplishments: things that you understand much better now.
  • Challenges: things that you are still working on understanding.

I will provide direct feedback to your writing.

Program Compiles; Tests Pass (=15)

This includes that your code should be professional.

  • Try to proofread your work like an essay!
  • Find all your println("stuff") statements and remove them, etc.
  • Your code looks intentional: don't just fiddle with it until it works. Reason about it! Sketch out the python by hand and then try translating to Java.
  • Delete commented out code or experiments that don't work out. Make your submission as small as it needs to be.
  • Your code is your own. Respect the honor code.
  • Working with others or helping them debug is acceptable - use your best judgment! Make sure that you know what you're working on.
  • Have comments explaining tricky code!

Test coverage (=56).

There are some intentional bugs in the MapADT implementing code and (likely) some accidental bugs. See if you can catch them.

SetADT (=16)

  • size
  • insert
  • contains
  • remove

MapADT (=16)

  • put
  • get
  • size
  • remove

ListADT (=24)

Make use of the structure I created for you in makeFullList. The following methods need tests:

  • setIndex
  • addIndex
  • addBack
  • removeBack
  • removeIndex
  • removeFront

Try to understand what's going on with the new errors: BadIndexError, and EmptyListError in particular. One of these methods has a bug; i.e., something I put in to make it behave badly. Make sure you have a test for that case!

Testing (and completeness)

It is impossible to fully prove these some of these methods work for every collection. Consider how to find a balance between proving it works to yourself and making a lot of tedious code.

Coding Challenges (=12 + 12)

Writing code and tests for these methods (see Challenge.java) is worth 12 points, and 12 if you have tests (beyond the simple one I gave).

  • intersection (4 + 4)
  • union (4 + 4)
  • wordCount (4 + 4)

ADT-Reductions: Construct one data structure from another and test it. (=?)

  • class SetFromMap<T> extends SetADT<T>
  • class SetFromList<T> extends SetADT<T>
  • class MapFromList<K,V> extends MapADT<K,V>
  • class ListFromMap<T> extends ListADT<T>

csc212adtr's People

Contributors

jjfiv avatar

Watchers

James Cloos 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.