Coder Social home page Coder Social logo

workday's Introduction

Address Book Application

AddressBook is a simple application that associates email addresses with names (see Book interface). A simple explanation about the application architecture is:

  • A name is either an alias or a group
  • An alias maps to an email address directly or to another name (forming a name chain)
  • A group is like an alias but it can refer to one or more addresses or names
  • Any name belonging to the book must map (directly or indirectly) to at least one address
  • A name cannot be removed from the book if that name is the target of another mapping (e.g. alias in group)

Exercises

1. Correct Failing Tests

Running StandardBookTests as provided results in failures. Your first task is to add the necessary validation checks to make the tests pass (see Target class for an example)

2. Extend Book

BookExt interface contains two new methods. Your task is now to:

  1. Implement both methods in the existing StandardBook class
  2. Add tests for these methods in StandardBookTests

3. Fix a Bug

A user of the book application has reported that he gets a java.lang.StackOverflowError when doing a lookup on a group. He attaches some debug output of a book that generates the error (see below).

  1. Write a test to reproduce the problem
  2. Modify the book class to fix the problem so all tests run successfully and class fulfills the contract of the Book interface
{Book 
 {Group 'Manager'} => [{Alias 'Jim'}, {Group 'Fire Marshal'}, {Alias 'Michael'}]
 {Alias 'Jim'} => [{Address '[email protected]'}]
 {Group 'Fire Marshal'} => [{Group 'Manager'}, {Alias 'Dwight'}]
 {Alias 'Dwight'} => [{Address '[email protected]'}]
 {Alias 'Michael'} => [{Address '[email protected]'}]
}EndBook

Your next task is to fix the problem reported by the user.

4. Optimize Book

Your task is now to rewrite the lookup methods so that neither method uses recursion.

Evaluation Criteria

Your implementation will be evaluated against the following criterias:

  • Unit test coverage
  • Code cleanliness
  • Code cohesion and couplinbg
  • Unnecessary checks, variables and data structures created
  • Performance
  • Code coupling and cohesion

When the code is submitted we assume that it would be production ready and we evaluate what would be the outcome of that.

In case of questions you can contact us and we will help you as soon as possible. Good luck and have a nice coding. :-)

workday's People

Contributors

anaabia 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.