work-test/OOPerlTest-Personal-0.01
2012-09-06 20:08:56 -07:00
..
bonus Implementing manager 2012-09-06 19:45:01 -07:00
docs Initial import of the test. 2012-09-06 15:48:09 -07:00
lib/OOPerlTest all tests pass 2012-09-06 20:08:56 -07:00
t Implementing manager 2012-09-06 19:45:01 -07:00
Changes Initial import of the test. 2012-09-06 15:48:09 -07:00
Makefile.PL Initial import of the test. 2012-09-06 15:48:09 -07:00
MANIFEST Initial import of the test. 2012-09-06 15:48:09 -07:00
META.yml Initial import of the test. 2012-09-06 15:48:09 -07:00
README Initial import of the test. 2012-09-06 15:48:09 -07:00

OOPerlTest-Personal version 0.01
================================


INTRODUCTION

This module will be used as a test of your Perl programming skills.  The docs/
directory contains a UML diagram in PDF format that illustrates the various
classes and their attributes that you will need to implement in order to
complete this test.  You should also read the user stories (below) to get the
"big picture" for this collection of modules.

This test is given to all prospective Perl engineers at Rent.com as part of the
general hiring process; it is designed to evaluate your skill level,
understanding of OO concepts, ability to follow directions, and coding style.
There are two distinct components to the rating process.  The first is based on
the number of passing unit tests you are able to achieve.  The second part is
based on your coding style and overall documentation of the code.  It is not a
requirement to have all unit tests pass in order to be hired, but obviously your
total score will be higher with more passing unit tests.  The test should take
you about 2 - 4 hours, but if you need more time than that, take it.  Use your
own discretion.

Part of the test is to see how you choose to implement things, so don't be
afraid to make decisions on any points that are unclear in the docs.  There is
no right or wrong implementation.  You may choose to use any CPAN libraries you
like, or use none.

Remember:

* You do *NOT* have to make all the unit tests pass to be considered.

* Don't spend more time on the test than you think is reasonable.

* If you have questions about the test, please send email to buddy@rent.com.

* Once you're done, see the section marked "PACKAGING THE TESTS FOR RENT.COM".



USER STORIES

We use Agile as an integral part of our sofware development process.  Here are
the specifications of the classes to be written, in the form of user stories.

    User Story #1
    -------------
    A person must have a name and a date of birth.  They may optionally have an
    alias.

    User Story #2
    -------------
    A work unit must have a project, a task, and a status.  The status must be
    one of the following: NotStarted, Started, Completed, or Rejected.  It may
    optionally have a payload, which is a string consisting of one or more lines
    of text.

    User Story #3
    -------------
    An employee is a person.  An employee must have a hire date.

    User Story #4
    -------------
    An employee can perform work.  Performing work requires a work unit to be
    operated on.  When a work unit is processed by an employee, its payload is
    checked for any lines that begin with a date in the form MM/DD/YYYY.  If any
    such lines are found, the initial date is replaced with the same date in the
    format YYYYMMDD.  Any text on the line after the date is left unchanged.
    Any dates in the middle of the line are left unchanged.  Any lines which do
    not begin with a date in the form MM/DD/YYYY are left unchanged.  If any
    lines were modified by the work, the status of the work unit is changed to
    Completed.  If no lines in the payload were changed, or if the work unit has
    no payload at all, the status of the work unit is changed to Rejected.  The
    updated work unit is returned by the employee's work method.

    User Story #5
    -------------
    An employee may quit.  When they do so, they cease to be an employee,
    although they are still a person.  (The person object is returned by the
    Quit method.)



BONUS TESTS

In the bonus/ directory, there two extra components that you may also attempt if
you like.  These are completely optional, and are provided as a way for you to
demonstrate your skills in both a broader and deeper fashion. If you have extra
time after completing the main test, feel free to work on the bonus tests.  You
will *not* be downgraded in any way for not attempting the bonus tests.

Bonus #1
--------

The file script_test.pl contains some data and a description of a programming
problem.  Add code to the script to fulfill the requirements laid out in the
comments.

Bonus #2
--------

You may notice that the UML document contains an extra class, Manager, which is
not mentioned in either the user stories above, or the test files in the t/
directory.  The .t file in the bonus/ directory contains some tests that
exercise this class, and its skeleton .pm file is in the lib/ directory in the
expected place.  Make as many of the tests as you are comfortable with pass.
User stories that describe the manager class are below.

    Bonus User Story #1
    -------------------
    A manager is an employee.  It maintains a list of employees that it manages.

    Bonus User Story #2
    -------------------
    A manager can hire someone.  This requires a person and returns an employee.
    The employee is also added to the list of employees managed.

    Bonus User Story #3
    -------------------
    A manager can fire someone.  This requires an employee and returns a person.
    The employee is also removed from the list of employees managed.

    Bonus User Story #4
    -------------------
    A manager can perform work.  Performing work requires a work unit to be
    operated on.  A manager delegates the actual work to their employee(s).  The
    manager keeps track of how much work was completed and how much was rejected
    and can report on these totals.

    Bonus User Story #5
    -------------------
    A manager may quit.  When they do so, they cease to be a manager, although
    they are still an employee.  (The employee object is returned by the Quit
    method.)



CONTENTS

Blank .pm files that should be used to implement the classes illustrated in the
UML diagram can be found in the lib/ subdirectories.  The Personal.pm file
should be used for general documentation; each of the other files should be used
for specific documentation and actual implementation.

lib/OOPerlTest/Personal.pm
lib/OOPerlTest/Personal/Person.pm
lib/OOPerlTest/Personal/WorkUnit.pm
lib/OOPerlTest/Personal/Person/Employee.pm

There are four test files containing a series of unit tests to ensure that your
implementation satisfies the UML specificiations.

t/01-Personal-Person.t
t/02-Personal-WorkUnit.t
t/03-Personal-Person-Employee.t

Files for the bonus tests are:

bonus/script_test.pl
lib/OOPerlTest/Personal/Person/Employee/Manager.pm
bonus/04-Personal-Person-Employee-Manager.t



RUNNING THE TESTS

In order to run the test suite, type the following commands:

   perl Makefile.PL
   make
   make test



PACKAGING THE TESTS FOR RENT.COM

To package your implementation type the following commands:

   perl Makefile.PL
   make
   make dist

This will create a file OOPerlTest-Personal-0.01.tar.gz in the main directory.
Please send this file as an email attachment to jobs-tech@rent.com for final
scoring.



COPYRIGHT AND LICENCE

All rights reserved.

Copyright (C) 2011-2012 by Rent.com

This test is property of Rent.com.  Do not publish, distribute, or otherwise use
this test for any other purpose without the written consent of Rent.com.