Overview
Recruit Me is a Java Desktop GUI application that is specifically designed for a recruiting agency for their processes about the candidates in their storage.
Summary of contributions
-
Major enhancement: added filtering command
-
What it does:
-
Filters the persons according to their every single aspect (Name, Phone, Email, Skills, …)
-
Can manage multiple filtering at the same time and also the filter can be cleared in any time the user wants.
-
Filtering command has 4 different branches in itself:
AND, OR, REVERSE, CLEAR
(For detailed explanation, please read filtering part in UserGuide).
-
-
Justification: This feature improves the usability of the product significantly, because it can eliminate all the candidates that are not fitting for the wanted job positions. Makes classification and searching easier.
-
Highlights: This new feature affects all the commands already implemented and all other commands that will be implemented in the future. Thus, the interaction of this command with other commands are strongly investigated and minor changes for other commands are also made to make the other commands compatible with filtering.
-
Related Pull Requests for This Feature:
-
-
Minor enhancement:
-
added CV representation for selected persons. Shows the matching CV for selected person, if there is an available CV in the storage for that person
-
Some minor changes are made for the methods in
AddressBook, ModelManager and VersionedAddressBook
classes thatAddCommand, DeleteCommand and EditCommand
uses for the compatibility with filtering process. -
Fixed almost all failing
system tests / GUI related tests / Edit Command tests
in every update process of the process: -
Travis Checkstyle errors
are fixed mostly by me: -
Coveralls and Codacy
is implemented for the repository:
-
Contributions to the User Guide:
-
About multiple person addition (planned for v2.0) a new section is added.
-
Filtering process is added to the User guide as a new section:
UserGuide → Features → Filtering Recruit Me: filter
-
For the newly implemented CV showing process, a section is added (Not linked below, you can check from the User Guide):
UserGuide → Features → Showing and Updating the CV for a Person
-
Updated
Add Command / List Command / Select Command Sections
.
Filtering Recruit Me: filter
-
It filters the current applicant pool regarding the existing entities of every single person (name, phone, email, address, gpa, education (school), degree level, position, endorsement count or skills).
-
Format:
filter or/and [name<NAME>name] [phone<PHONE>phone] [email<EMAIL>email] [gpa<GPA>gpa] [edu<EDUCATION>edu] [deg<DEGREE-LEVEL>deg] [addr<ADDRESS>addr] [skill<SKILL1, SKILL2, … >skill][pos<POSITION1, POSITION2, … >pos] [end<ENDORSEMENT>end]
For every field, using < or > can cause false results. Please do not use them in filtering criterion texts. All the fields are optional but at least one field should be used.
|
Examples:
-
filter or phone<91234567>phone email<mail@ex>email skill<C++, Java>skill end<2>end deg<4>deg
-
Returns the people, whose numbers include
91234567
or whose email includesmail@ex
or who has (contains) at leastC++ or Java
in the skills or has at least2 endorsements
or has at leastMaster’s degree
.
-
-
filter and name<ale>name addr<street>addr gpa<3.1>gpa pos<Manager, Developer>pos deg<bachelors>deg
-
Returns the people, whose name contains
ale
(in any uppercase and lowercase format) and whose address containsstreet
and who is interested inManager and Developer
positions,has a GPA higher than or equal to3.1
and has at leastBachelor’s degree
.
-
Clearing the filter in Recruit Me: filter clear
It clears all the filters in the applicant pool.
Format: filter clear
Reversing the filter in Recruit Me: filter reverse
It reverses all the filtering conditions and shows the eliminated ones.
Format: filter reverse
Contributions to the Developer Guide:
-
A new section for filtering is added to the developer guide,iImplementation of the whole process including testing is explained in detail:
DeveloperGuide → Implementation → Filter or/and/clear/reverse feature
(In the document below, basic explanation of the command types and valid input format of the related fields are excluded. Please look at the beginning part of the DeveloperGuide or read UserGuide section about filtering process to have a better understanding of the process) :
Current Implementation of Filter Command
Implementation Details:
-
Class Diagram of the Filtering Command:
-
Sequence Diagram of the Filtering Command:
-
Filtering is parsed in
FilterCommandParser
class, directed inFilterCommand
class for further processing and actual filtering process took place inAddressBook
class. -
Working Principle of
FilterCommandParser
Class-
The input is trimmed (spaces at the beginning and at the end are cleaned), cleared from multiple spaces and turned into lowercase form.
-
By checking the first number of characters of the input, the type of the process is determined (
and
,or
,clear
orreverse
) and stored in aninteger
value. If the input has none of them, an invalid input message is shown. -
Since there are 10 different fields that can be filtered, a
String array
with size 10, called criterion, is created and the values are set to " " in initialization. -
If the type is
clear
orreverse
, a newFilterCommand
object is called with passing thecriterion
array and theprocess-type-holding-integer
for that method. If it is not, followings take place. -
The prefixes are searched. For each of the fields, these controls are made:
-
Checked if the
PREFIX
exists in the input for the searched field. -
If it is, then
REVERSE PREFIX
for that field is also searched and if that is also found, it is checked that if thePREFIX
is placed beforeREVERSE PREFIX
. -
If it is not, or if the search cannot reach to this step, then an invalid input message is shown.
-
If the steps are passed successfully, the element in the
criterion
array for this field will be changed to the value"available"
e.g. if the input isfilter or phone<57>phone
, then thePREFIX
andREVERSE PREFIX
locations are correct, the 21st index (related index for the phone in the array) of thecriterion
will be set to"available"
. -
Since the parser looks for the first occurrence of
PREFIX
andREVERSE PREFIX
, if there are multiple filtering parts for the searched criteria, then the first one will be taken.
-
-
For the available fields (the ones with the regarding
criterion
indexes are set to"available"
), an input check is made for the the text between thePREFIX
andREVERSE PREFIX
. For the non-available filtering conditions, the value incriterion
for the related field is set tonull
. -
If the parameters does not pass the input check, an error is thrown, which says the input is in invalid form. If they passes the input check, then the index for the regarding field in
criterion
array is set to the text value between thePREFIX
andREVERSE PREFIX
.
e.g. the 1st index ofcriterion
is set to57
regarding to the example above. -
FilterCommand function is called. In the parameters
criterion
andprocess-type-holding-integer
passed to the object constructor.
-
-
Working Principle of
FilterCommand
Class-
For each 10 fields of the filter command criterion, a
string
parameter is constructed and the values are set regarding the values incriterion
array. If no value for that field is present, the parameter in theFilterCommand
class is set tonull
. -
Since
SKILLS
andPOSITIONS
fields can contain more than one criterion inside (all the criterion are separated with ", " for these), the string values incriterion
array regarding to those fields are split through "," usage and the data for these are stored inString[]
parameters created inFilterCommand
class, instead ofString
parameters. -
Also the type of the process (
and
,or
,clear
orreverse
) is stored in a parameter inFilterCommand
, too. -
According to the process type, one of the methods
filterAnd()
,filterOr()
,clearFilter()
orreverseFilter()
is called throughModel
interface and these methods inModel
also called the one of these methods inAddressBook
class with the same name. -
For
filterAnd()
andfilterOr()
methods, the values for every single field are passed through the method call.
-
-
Working Principle of
AddressBook
Class for Filtering Purposes-
In the AddressBook class, a new
UniquePersonsList
parameter calledallPersonsStorage
is added. -
When the filtering method is used, the
persons
parameter in the class is updated according to the filtering criterion (the persons that are not matching the conditions are removed). However, in order not to lose data, the new addedallPersonsStorage
parameter is not being changed with the filtering processes. It still continues to store every single person in the application storage. -
When clearFilter() method is called, if there is a filtering available, every single person who is not in
persons
parameter but inallPersonsStorage
are added to thepersons
storage. So basically, it is right to say thatpersons
parameter only holds the persons we expect to see in the GUI. -
When reverseFilter() method is called, if there is a filtering available, every single person who is in
persons
parameter is replaced with the persons who were not stored in this parameter before. -
When filterOr() method is called, every single person in
persons
parameter is traversed and the ones that do not contain none of the criterion set through input are removed frompersons
. -
When filterAnd() method is called, every single person in
persons
parameter is traversed and the ones that do not contain even one of the criterion set through input are removed frompersons
. -
The information if there is a filtering available in the application, is also stored in a boolean parameter in
AddressBook
and set true withfilterAnd() and filterOr()
methods, set false with the initial launch of the application,clearFilter()
call andAdd Command call
(because it increases the size of the data and it is not know that if the newly added person fits the filtering criterion or not). -
Filter-keeping-parameter is important, because with
undo and redo commands
, it is important to maintain the filtering state in order not to lose any data and in order to useclearFilter()
method.
-
Alternative Approaches
In this title, both Command implementation and Parser implementation will be discussed in 2 parts:
Command Implementation
Instead of adding another parameter in AddressBook
class called allPersonsStorage
, another approach would be letting persons
parameter to hold
all the unfiltered information and updating filteredPersons
parameter in the ModelManager
class. filteredPersons
is a list of persons that is defined in ModelManager
.
It is especially used in FindCommand
, that applies a basic filter to the list of persons in the application with only one criteria NAME
.
However, filteredPersons
is implemented with Predicate
approach.
-
Pros of this approach:
-
Does not need any additional permanent parameter to be created in AddressBook class.
-
Decreases the number of changes made in each list changing method of the AddressBook class. Because, if any additional parameter is added to AddressBook class, all the functions have to be changed considering the new parameter.
-
-
Cons of this approach:
-
It is hard and time consuming to implement this approach because
Predicates
are used. InAddressBook
class itself, we can directly reach to the persons and their all fields easily. But withPredicate
approach, it requires additional data to be built (Predicates
may need to be created before adding new persons to the parameter). Moreover, we do not have much knowledge aboutPredicate
usage and because of these reasons, our job may take more time to finish.
-
Parser Implementation
Instead of putting the criterion contents between both PREFIXES
and REVERSE PREFIXES
, we
could only add the content after PREFIX
(without any REVERSE PREFIX
usage) like the addition process .
-
Pros of this approach:
-
User would need to write less number of characters
-
-
Cons of this approach:
-
Using also reverse prefix makes the job much easier, because it simply marks also the end of the content.
-
In currently implemented version, no order of the criterion is necessary. So, first phone number and then name etc. can be added for filtering condition. However in the alternative approach, implementing the input taking with no order is harder and time consuming.
-
Testing of Filter Command Design
The testing methods for filtering is written for 3 different parts:
FilterCommandParserTests
-
This test class is prepared for unit testing of FilterCommandParser cass. With the tests:
-
The validity of inputs with single and multiple field are present are checked.
-
The given order of inputs are checked in case of any possibility for an error.
-
Empty command or
filter
command without any type specification are checked. -
The exceptions thrown are controlled, when the criterion are empty.
-
For
number
type of criterion, the negative and positive out of bound values, entering string values and entering valid values are checked. -
For
String
type of criterion, the type of characters allowed are checked.
-
FilterCommandTests
-
This test class is prepared for unit testing of Filtering Command. With these tests Filtering process are checked:
-
when a single or multiple criterion are given,
-
when filtering occurs multiple times,
-
when type is
clear
orreverse
and there are no/one/multiple filters are applied before.
-
FilterCommandIntegrationTests
-
This test class contains integration tests and investigates the interaction of
FilterCommand
with:UndoCommand
,RedoCommand
,AddCommand
,DeleteCommand
,SortCommand
,FindCommand
,SelectCommand
, and cases, when all of them are together. -
Each test case at least contains filtering with
or - success
orand - success
,clear - success
andclear - failure
,reverse - success
andreverse - failure
. -
Also for every interacting command, failure and success cases are both investigated.