-
Where would you fit your automated tests in your Recipe project development pipeline? Select one of the following and explain why.
- Within a Github action that runs whenever code is pushed
- Manually run them locally before pushing code
- Run them all after all development is completed
ANS: The automated tests should be run within a Github action that runs whenever code is pushed. This is because we want to ensure that the code is working as expected before it is pushed to the repository. For example, it can test whether a new function will break the entire program to prevent new pushes or PRs will crash the application. We also can enforce some style guidelines ,to make sure the code is readable and maintainable. It is also very convenient to run the tests automatically, and can be trigger by specific setting which is great.
-
Would you use an end to end test to check if a function is returning the correct output? (yes/no)
ANS: No, because an E2E test is meant to emulate user actions from start to finish. So, it is not meant to check if a function is returning the correct output.
-
Would you use a unit test to test the “message” feature of a messaging application? Why or why not? For this question, assume the “message” feature allows a user to write and send a message to another user.
ANS: No. Because unit test is focus on a individual part of the code such as a function. It is used to check whether a specific function is working as expected. It is not meant to test the entire application. In this case, we cannot use unit test to test the whole “message” feature.
-
Would you use a unit test to test the “max message length” feature of a messaging application? Why or why not? For this question, assume the “max message length” feature prevents the user from typing more than 80 characters.
ANS: Yes, just as mention above, because a unit test is meant to test a single function or method working as expect, we can use unit test to test the “max message length” function. In this case, we can make a function that returns the length of the message and test whether the length is greater than 80 and since it is a simple function, we can test it with a unit test.
forked from CSE110-FA22/Lab8_Starter
chizhang9135/Lab8_Starter
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- JavaScript 84.6%
- CSS 8.9%
- HTML 6.5%