3340 practice

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What is the git command to create a new branch?

git branch {branchName}

Where are feature specs located?

/features

Where are model specs located?

/spec/models

What is it called when new code breaks old code?

A regression

What is continuous deployment?

A workflow where changes are run through CI automatically and pushed to github. This automates the deployment process.

What can we call a test that proves we implemented a high-level feature that the customer/boss/client wants?

Acceptance tests

How does it relate to the spirit of agile?

Allows communication with a team and between the developers and the customers. Allows the developers to focus on functionality and features, without dealing with documentation.

What is the best way to achieve confidence in a growing code-base?

Automated tests

What are some of the benefits of automated testing?

Automated tests save time and money as they catch more bugs and at a faster than humans, reducing the amount of manpower needed. Allows developers to continue working without leaving editor.

What is the tool that lets you simulate a browser in tests?

Capybara

How does continuous integration help maintain a stable master branch?

Checks if the application passes the test suite without introducing any regressions. Runs automatically whenever new code is checked in.

What happens at the "Refactor" step?

Clean up the working code. Simplify and organize the working code as much as possible. (Also includes the tests)

What is a test suite?

Collection of tests which ensures that your program works as intended.

What is the tool that lets you write user stories as test in plain English?

Cucumber

Code Review = _____________ + Code

Discussion

Why should we use continuous integration?

Ensures that high quality code is always being produced and that no regressions are being introduced to the code base. Also lets you know if the program will work in different environments as the tests are run in an independent environment.

Why are QA teams not a replacement for good testing practices?

Expensive and cannot catch as many mistakes or run as many tests as a machine could do automatically.

What is one of the biggest obstacles that developers have that stops them from using TDD?

Fear of not knowing whether to start with high (integration tests) or low level (unit tests) tests

What are the three types of major test in Rails?

Feature Specs Request Specs Model Specs

What are some of the benefits of code review?

Gives a second pair of eyes and helps give confidence to the developer. Helps the reviewer get a better understanding of the code base.

What are the benefits of using Test-driven Development?

Gives confidence to the Developer that the code functions and behaves properly. Saves Time, improves design and encourages a good workflow as well.

How does good testing practices enable confidence?

Good testing practices gives developers confidence to introduce large changes without fear of introducing regressions as the tests would notify them.

What is FactoryBot used for?

Helps conduct test on models and their behaviors by scripting ways to create dummy instances of a model.

Why are integration test generally slower than unit tests?

Integration tests must simulate all possible actions of a user while unit tests only check functions in isolation.

What is the type of testing used to check the models work as intended?

Model Specs

If your code is "red", meaning some of the tests failed in continuous integration, should you merge it?

No, you should check it and redo until the tests are passed.

What happens at the "Green" step?

Read and attempt to understand why the test is failing. Write as little code as possible to pass the test. Do not worry about code quality yet.

What are the three steps to TDD?

Red, Green, Refactor

What is the type of testing used to issue direct HTTP calls to the application to check whether our HTTP requests work as intended?

Request Specs

What is the tool that allows us to expect certain things and causes a test to fail if the expectation is not met? (This tool is used in all types of Rails testing)

Rspec

What are some of the things that code reviewers should look for?

Test Coverage Missing Test Cases Check for Company Style Judge Readbility If Code can be Refactored

What are unit tests?

Test individual components in isolation, that they have the desired behavior and result

How does a test suite serve as living documentation?

Test suites, unlike comments, never go out of date as they constantly need to be updated to test new additions. As every test covers pieces of the app, it is easy to go to the test itself to determine what a piece of the app should do and if it functions properly.

What are feature tests used for?

Test the happy paths. Check is app shows feature to the user.

What are Model Specs for?

Tests to see if model works as intended.

What are integration tests?

Tests which check the code and system as a whole from the user's perspective.

Where do you go if you are unsure of how an applications supposed to work?

The test suite as it tells you what the expected behavior should be and what is wrong.

When working on an application, why is it important to consider the sad paths and not just the happy paths?

To avoid malicious users from being able to enter and modify the software by using http requests. Also prevents users from entering wrong information that could crash the software/program.

What is cucumber and which type of testing does it help with?

Tool which helps write and run feature specs.

What are Request Specs for?

Use HTTP requests to make direct get/put/post/patch requests to check if controllers work properly (Checks sad paths)

How do we amplify that confidence and achieve bigger wins in time savings and code?

Use Test Driven Development, which is a process that drives the design and development of an app through tests.

When should you use inside-out development (low to high level?

When you have little to know idea of how the UI is supposed to look like or interact with the models. If you have ideas of the different components, it helps you build up the program as you go along

When should you not use TDD?

When you have no idea of the code base or certain functions (experiment with the code instead) When its a small program and easy to test manually If the program is not intended to be used for more than a few days

When should you use outside-in development (high to low level)?

When you know what the UI is supposed to do and look like.

How does effective branching, automated testing, continuous integration, pull requests, and code review all help and contribute towards preserving a master that is always working and ready to deploy?

Work together to preserve the master branch by ensuring that both high quality and properly functioning code are the only things being added. Also ensures no regressions are introduced.

Why is it important not to work in master?

Working on master can corrupt if you leave unfinished code and can also open up to introducing regressions to the code base. Also makes it difficult to undo things you added and want to remove.

What happens at the "Red" step?

Write tests that covers the behavior you want to see. The test should fail but will let you know what you need to do.

Can Cucumber tests be considered acceptance tests?

Yes, as they test that the app works from the user's end and that the desired behaviors are implemented correctly.

Are cucumber tests integration tests?

Yes, help test the implemented features display the correct behavior from the user's end.

Can you have many different branches at the same time?

Yes, it is encouraged as good practice. Allows multiple teams to work on different features at a time.

When you open a Pull Request, what do you expect someone on your team to do?

You expect them to review your code, leave comments and create a discussion. Also expect them to either deny or accept the request.

What is the git command to create and checkout a branch at the same time?

git checkout -b branchName

What is the git command to checkout a branch?

git checkout {branchName}

Where are request specs located?

spec/requests


Set pelajaran terkait

Final: Quiz 5 Microservices and Containers

View Set

Py4e: Chapter 12; reading web data from Python

View Set

chapter 4 psychological theories

View Set