My name is Vance, I have worked in the industry as a Software Testing Engineer at ASML, and as a Web Developer for Berkshire Hathaway HomeServices California Properties. When I'm not coding, I am usually playing video games (currently Diablo 4).
-
- Please click the link to see operational photos of the application
- Code snippets have been provided below in the Details section
- Black Jack console application built in Python
- Utilizes Object Oriented Programming (OOP) methodologies
- Uses Flask for testing class methods
- Logs to a log file using the python logging module
Details
TL;DR: Application uses classes to initialize several aspects of the game to present to the user. Upon the result of the game, the user is asked to play again if they choose. Test methods were written to provide coverage to limit defects.
- Classes
-
Card
-
Deck
-
Hand
-
BlackJack
-
TestCard
-
TestDeck
-
TestHand
-
TestBlackJack
-
Methods
-
Card
-
Deck
-
Hand
-
BlackJack
- This is the main class
- Getters and Setters
- getName
- getIsPlaying
- setName
- setIsPlaying
- Methods
- hit
- Adds a card to the hand list and adjusts the value of an ace accordlingly if the player decides to 'hit'
- hitStay
- Prompts the user to ask if the user would like hit and to add a card to his hand or would like to stay.
- Checks for only the words 'hit' or 'stay'
- If the response from the user is different from the check, the user is prompted again to provide the necessary response.
- showCards
- Displays the dealer's and player's hands along with their values in formatted print statements
- play
- Prompts the user to enter his/her name
- Utilizes a while loop to play multiple games
- Checks if the player's hand value ≤ 17 and starts a while loop to allow the player to raise said value if they choose.
- Checks the values of the dealer's hand
- If the value is ≤ 21, a while loop will start until the value ≥ 17
- Uses condition statements to decide who the winner is of each game
- Prompts the user if they would like to play another game.
- hit
-
TestCard
-
TestDeck
- Fixtures
- create_deck
- Appends the card and suit list to the deck list of Cards and returns it.
- create_deck
- Test Methods
- Fixtures
-
TestHand
-
TestBlackJack
-
-
- Please click the link to see operational photos of the application
-
- Please click the link to see operational photos of the application
- Code snippets have been provided below in the Details section
- FlaskAPI application that utilizes ElephantSQL
- Builds an API for rooms, room temperatures, and a tic-tac-toe game
Details
TL;DR: Application creates rooms and temperatures utilizing ElephantSQL queries. Test methods were written utilizing a test database to mock data and limit defects.
- Routes
-
'/'
- Returns a string of 'Hello Monty'
-
'/api/room'
- Grabs the name variable from a JSON object
-
'/api/temperature'
- Grabs the temperature and room id, and datetime from a JSON object
- If datetime isn't provided in the object, the datetime.now method will be called
- Creates temperature table if it doesn't exist
- Inserts room id, temperature, and date
- Returns message notifying the user that the temperature was added and a response code of 201
- Grabs the temperature and room id, and datetime from a JSON object
-
'/api/room/int:room_id'
- Grabs the id variable from the http path
- Selects the room by id
- Returns the room and response code of 200
-
'/api/avg_temp'
- Queries the database for the average temperature
- Returns JSON object containing average temperature and response code of 200
-
'/api/day_count'
-
'/api/tictactoe'
- Displays a tic-tac-toe game built using HTML, CSS Grid, and JavaScript
- Calls the render_template method from Flask to render grid.html
-
- Please click the link to see operational photos of the application
-
- Please click the link to see operational photos of the application and test plan
- Code snippets have been provided below in the Details section
- Logs HTTP response and application info to a log file using the python logging module
- Utilizes Test Driven Development (TDD) to build an API for creating enclosures for different animals
Details
TL;DR: Application builds an animal and enclosure API utilizing ElephantSQL queries. Tests have been written to test functionality and prevent defects.
-
Methods
-
create_enclsures
- Receives group_name from JSON object
- Creates Enclosure table if it doesn't exist
- Inserts group_name into the Enclosures table if a group_name doesn't exist
- Returns JSON object notifying the user that the enclosure was created
-
create_animals
- Receives name, quantity, enclosure_id from JSON object
- Creates Animals table if it doesn't exist
- Inserts name, quantity, enclosure_id into the Animals table if a name doesn't exist
- Returns JSON object notifying the user that the enclosure was created
-
get_animal
-
get_enclosure
- Receives enclosure_id from HTTP path
- Selects the correct enclosure by enclosure_id
- Returns JSON object to the client side
-
get_animals
- Selects all animals within the Animals table
- Appends the result to a data list of JSON objects
- Returns the data list to the client side
-
get_enclosures
- Selects all enclosure within the Enclosures table
- Appends the result to a data list of JSON objects
- Returns the data list to the client side
-
add_enclosure
- Receives group_name from HTTP Body
- Insert name into Enclosures if it doesn't exist
- Returns a JSON object notifying the user that the enclosure has been created
-
add_animal
- Receives name from HTTP Body
- Insert name into Animals if it doesn't exist
- Returns a JSON object notifying the user that the enclosure has been created
-
display animals
- Executes an inner join on enclosures and animals
- Appends the result to a data list of JSON objects
- Returns data list to the client side
-
-
Test Methods
-
test_connection
- Uses fixture called connection to create Enclosures table if it doesn't exist
- Inserts enclosure based on the sample date provided within the fixture if it doesn't exist
- Prints and logs the expected output and actual output
- Asserts that the length of the result > 0
-
test_create_animals
- Uses fixture called create_animals to create Animals table if it doesn't exist
- Prints and logs the expected output and actual output
- Asserts that the length of the result > 0
-
test_create_enclosures
- Uses fixture called create_enclosures to create Enclosures table if it doesn't exist
- Prints and logs the expected output and actual output
- Asserts that the length of the result > 0
-
test_add_enclosure
- Uses fixture called add_enclosure to insert an enclosure based on the data provided if the enclosure doesn't already exist
- Selects enclosures from the enclosure tables
- Prints and logs the expected output and actual output
- Asserts that the length of the result < 1
-
test_add_animal
- Uses fixture called add_animal to insert an animal based on the data provided if the animal doesn't already exist
- Selects enclosures from the animals tables
- Prints and logs the expected output and actual output
- Asserts that the length of the result < 1
-
test_display_animals
- Executes an inner join on the Enclosure and Animals tables
- Appends the results to a data list of JSON objects
- Asserts that the data > 0 and the type is list
- Prints and logs the expected output and actual output
-
- Please click the link to see operational photos of the application and test plan
-
- Please click the link to see operational photos of the application
- Code snippets have been provided below in the Details section
- Machinery Parts application built using Flask
- Utilizes MongoDB to create a parts store database
- Pytest methods accompanied by mocked methods to simulate MongoDB CRUD operations
Details
TL;DR: Application builds a machinery parts API utilizing MongoDB to perform CRUD operations. Tests with mocked MongoDB methods have been written to review outcomes and maintain overall quality of life.
-
Methods
-
index
- Executes query to find all collections
- Appends the result to a list
- Returns a JSON object if the list contains items
- If not, it returns a JSON object notifying the user that the query was not successful
-
get_part
- Executes query to find collection by part_id
- Returns a JSON object containing the collection
- If not, notifies the user that the search was unsuccessful
-
create_part
- Inserts a JSON object into the database
- Returns JSON containing the ObjectId generated by MongoDB
-
update_part
- Updates the database using the part_id from the response
- Returns a Success status if the matched_count > 0
- If not, returns a Item not found error code
-
delete_part
- Deletes an entry from the database using the ObjectId provided from the response
- Returns a Success status code if the deleted_count > 0
- If not, returns an Item not found error code
-
-
Mocked MongoDB methods
-
find
- Simulates a successful response from pymongo.collection.Collection.find method
- Sets return_value to a list of BSON objects
- Sets returncode to 200
-
find_fail
- Simulates an unsuccessful response from pymongo.collection.Collection.find method
- Sets return_value to a list contaioning a JSON object with a Item not found error
- Sets returncode to 404
-
find_one
- Simulates a successful response from pymongo.collection.Collection.find_one method
- Sets return_value to a list of BSON objects
- Sets returncode to 200
-
find_one_fail
- Simulates an unsuccessful response from pymongo.collection.Collection.find_one method
- Sets return_value to a list contaioning a JSON object with a Item not found error
- Sets returncode to 404
-
insert_one
- Simulates a successful response from pymongo.collection.Collection.insert_one method
- Sets return_value to a list of an BSON object containing the ObjectId of the collection inserted
- Sets returncode to 200
-
update_one
- Simulates a successful response from pymongo.collection.Collection.update_one method
- Sets return_value to a list contaioning a JSON object with a Success status
- Sets returncode to 200
-
update_one_fail
- Simulates an unsuccessful response from pymongo.collection.Collection.update_one method
- Sets return_value to a list contaioning a JSON object with a Item not found error
- Sets returncode to 404
-
delete_one
- Simulates a successful response from pymongo.collection.Collection.delete_one method
- Sets return_value to a list contaioning a JSON object with a Success status
- Sets returncode to 200
-
delete_one_fail
- Simulates a successful response from pymongo.collection.Collection.delete_one method
- Sets return_value to a list contaioning a JSON object with a Item not found error
- Sets returncode to 404
-
-
Test Methods
-
test_index
- Asserts that the response from the mocked find method that the return_value has a length > 0
- Asserts that a returncode of 200 was received
-
test_index_fail
- Asserts that the response from the mocked find method that the return_value has an Item not found error
- Asserts that a returncode of 404 was received
- Prints Expected and Actual output
-
test_get_part
- Asserts that the response from the mocked find_one method that the return_value has a length > 0
- Asserts that a returncode of 200 was received
- Prints Expected and Actual output
-
test_get_part_fail
- Asserts that the response from the mocked find_one method that the return_value has an Item not found error
- Asserts that a returncode of 404 was received
- Prints Expected and Actual output
-
test_update_one
- Asserts that the response from the mocked update_one method that the return_value has a Success status
- Asserts that a returncode of 200 was received
-
test_update_one_fail
- Asserts that the response from the mocked update_one method that the return_value has an Item not found error
- Asserts that a returncode of 404 was received
- Prints Expected and Actual output
-
test_delete_one
- Asserts that the response from the mocked delete_one method that the return_value has a Success status
- Asserts that a returncode of 200 was received
-
test_index_fail
- Asserts that the response from the mocked delete_one method that the return_value has an Item not found error
- Asserts that a returncode of 404 was received
- Prints Expected and Actual output
-
- Please click the link to see operational photos of the application