/tdd-nodejs-find-a-person

Instructions and starter code for SE course HW 4

Primary LanguageJavaScriptCreative Commons Zero v1.0 UniversalCC0-1.0

TDD Kata - FindAPerson

A repository and starter for HW4 of the JCE Software Engineering Course

Build Status codecov.io

Intro

In this homework we are exercising Test Driven Development. In this software development method code is written through the following cycle: Test (Red) -> Code (Green) -> Refactor. See lecture slides for more details and resources. We will also use git to document the process.

You can either follow the given problem or ask the course team for another problem, e.g., from the Kata page in the lecture slides.

Background Story

This excecise was prepared in Honor of Or A. R.I.P who died during the 2015 Nepal earthquake.

Let's take a look at Ushahidi, which is a platform, services and tools for geographical crowd sourcing, e.g., for coordinating rescue eefforts following a natural crisis (Nepal).

The Crowdmap - Basic Features, are:

  • Create a post
  • Create a Map
  • Find Posts
  • Find a Map
  • Collaborate
  • Find a Person: This feature will be added at a later date. Stay Tuned
  • See all the latest Posts
  • See all the latest photos
  • Map view
  • View a post by Location

Since they state that there is a missing feature, we are going to add it! For a start we do not assume dependecies on exising code rather we will discover and implement only the necessary dependecies.

The Actual Problem, Add a Feature: Find a Person!

  • Given a person name, return all posts (of a map) containing her name (in any of a post fields), example:
    • Input: "Or A."
    • Output: ["I met Or A. at Chabad house Bangkok", "We found Or A. R.I.P at Langtang valley"]
  • Given a name, check if the map includes a location information for it (a place or geo. location), example:
    • Input: "Or A."
    • Output: True
  • Check if there are map inconsistencies, e.g., the same name with different locations. Example:
    • Input: nepal map (with content as above)
    • Output: True (since the name appear in more than one location)

Work Instructions

  1. To start, fork the exercise repository (For later updates to this instructions: first add a remote to the upstream repo and sync with a pull: git pull upstream master).
  2. Clone the repository to your workstation.
  3. Install needed dependencies (see slides): npm install
  4. Check that you can run tests: npm test
  5. Modify/add files (in the repository directory) to complete your solution.
    • Each TDD phase needs to be git committed separately with a suitable message that tells the TDD stage and achivement, e.g. “RED: Test for finding a name” (at least 7 RGR steps).
    • You can also do it with pair programming, but you must switch roles between RED and GREEN, including commit author (see here, there is also a fun Eclipse game to guide it).
    • Please don't commit compiled and project files.
    • You can suggest other features by editing the requirements above.
  6. Push/sync the changes up to GitHub.
  7. Create a pull request to the original repository to turn in the assignment, don't forget to:
    • Assign the TA for checking
    • Mention your pair in PR commits, if rellevant.
  8. Need help? ask at the course forum. Found a bug or have an improvement suggestion? please open an issue here or send a PR.

(A pull-request screencast demo - done for another course)

Submission and Dates

Submit a pull request by the Tirgul in 3 weeks, also use the regular submitting form and put there a link to your PR, in the format: #1

We will give feedback through the pull-request system. After getting feedback, you have one more week for improvements (push changes, and leave a comment asking to check again).
When the PR is closed you finished the excercise.

Good luck!