Exercise 1 - Task 1 - Implement Chat Bots
The goal of your team is to write funny chat bots to contribute to our chat bot system that can talk about your most favourite topics.
Goals:
- Every pair of developer has implemented one chatbot to talk about a topic.
- The chatbots are well integrated with other chatbots from the same team on the team's feature branch.
- The Jenkins CI build for your team branch is still happy with your software and all your chat bots are well tested.
- Your feature team is ready to integrate your chat bots on the develop branch with other chat bots from other teams for next release.
Follow these steps to implement your chatbot (time approx. 30-40 Minutes):
- Update the project to the latest state (
VCS/Update Project...
). - Switch to your team's feature branch (Bottom right you can click on
Git: master
to switch to another branch, choose your team's remote branch and chooseCheckout as ...
and clickOk
). - Create a new chatbot class similar to the class
WelcomeBot
in the same package - Give your chatbot a nice and unique name in
getName()
. - Implement a well description in
getDescription()
for your chatbot giving some hints about which topic the chat bot will reply to. - Define in
canHandleMessage(..)
for which keywords in messages the bot reacts with answers. - Implement the
getAnswer(..)
method to give some funny answers depending on the keywords. - Create and register your bot in the class
ChatBotFactory
- Write a test for your bot similar to
WelcomeBotTest
(you can copy and adjust it) - Make sure all tests are still passing (
src/test/Run all Tests ...
orGradle/Tasks/build
). - If any test fails, you need to fix it.
- Commit your changes (
Version control
rider at the bottom left, chooseLocal Changes
, select all changes and selectCommit ...
from context menu)- please review in the commit dialog all your changes carefully and only commit what you really wanted to change!
- by double clicking on each file, you can see all changes in each file
- it is bad practice to commit anything that you changed by accident, this might disturb your colleagues
- Pull other's changes from your team's branch to integrate with other's changes (
VCS/Update Project...
)- This step might mean that you get conflicts and need to merge some changes in some files (you will see a dialog in this case, here you can merge file by file, ask for help if you are unsure how to do it)
- Important: After merging conflicts you need to commit again!
- Push all changes to the remote repository (
VCS/Git/Push...
) - Verify the Jenkins CI build is passing for your changes:
- Go to http://sinv-56080.edu.hsr.ch/job/project-automation/
- Login with user
student
and paswordautom@tion$1
- Browse to your team's branch and verify the build successfully runs for your changes
- Check the "Changes" log on the last executed build run (listed on the left side)
- If not yet executed go back to the main build page for the whole project and choose "Scan Multibranch Pipeline Now"
- Wait until the build and tests are executed
- Study the test result reports:
- Are all tests on your branch successful? Otherwise correct them.
- Were the new tests for your new added chat bot executed?
- Study the Test Coverage Report of
Cobertura
(if available):- Did you cover the new functionality with tests?
- Should you take some action to cover the new functionality?
- Study the Code Quality Reports of
Sonar
- How well is the quality of current code?
- Did you introduce some quality issues in the code?
- Do you see some actions that should be taken from this quality measurements?
- When done, try to help the other pairs of your team to get their bots well integrated and pushed to the team branch. They might need some help.
- You are finished if all bots in your team are well integrated and your CI for your team's branch with all bots passed (=blue) with all the changes on it.
Hints:
- Consider the slides about
Continuous Integration
from lecture about the CI process - Consider the Tutorial for Development Environment for help with the development environment
- Consider the Tutorial for using Git in IntelliJ for working with Git
Solution / Cheat Sheet: In case of problems or to not loose to much time with coding, just consider the Solution for Task 1 about how a simple "funny chat bot" implementation might look like.
Done??
You are finished with this task as a feature team, when the team has added
at least two funny chat bots on their feature branch,
and the Jenkins build is run and still successful (no tests broken) for all their bots.
Did you also test/review your bots manually? Startup the system and talk with the bots.
When you think you are finished and ready for the release as a team, then ask the trainers for the next task.