Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In
Continue with Google
Continue with Facebook
or use


Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here
Continue with Google
Continue with Facebook
or use


Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.


Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Continue with Google
Continue with Facebook
or use


Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Stack Ask

Stack Ask Logo Stack Ask Logo

Stack Ask Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 5764
In Process
Nguyễn Thái Sơn
  • 0
Nguyễn Thái SơnProfessional
Asked: May 7, 20222022-05-07T07:16:14+00:00 2022-05-07T07:16:14+00:00In: Anything

sự khác biệt lớn giữa Unit test và Automation test

  • 0

em chào anh, em muốn hỏi thật sự về sự khác biệt Unit test và Automation test ạ, về cả 2 cùng 1 mục đích là test chức năng cho 1 function cụ thể với expectation, nhưng khi nào dùng automation test, khi nào dùng unit test trong tình huống thực tế vậy ạ

  • 1 1 Answer
  • 25 Views
  • 0 Followers
  • 1
Answer
Share
  • Facebook
  • Report

1 Answer

  • Voted
  • Oldest
  • Recent
  1. Thành Lê Văn Beginner
    2022-05-07T15:51:21+00:00Added an answer on May 7, 2022 at 3:51 pm

    Hmm, nếu bạn hỏi về unit test và integration test thì có vẻ hợp lý hơn. Tuy nhiên Unit test và Automation test thì mình cũng sẽ cố gắng giải thích cho bạn dễ hiểu.

    Unit test

    Với Unit Test thì Dev sẽ viết các test này bằng code để chạy test, tuy nhiên có rất nhiêu bạn chưa hiểu rõ vè Unit Test.

    Giống như tên của nó có từ Unit, các test này sẽ test từng Unit (Từng function, method) nhỏ nhất có thể.

    Với UnitTest thì tất cả các dependency sẽ cần mock, chúng ta sẽ chú trọng và logic và sự đúng đắn của các code logic trong function đó.

    Ví dụ bạn có một function thực hiện call một method của một class do người khác viết và call API.

    Với UnitTest thì kết quả của method do 1 người khác viết bạn cần phải mock. kết quả của việc call API bạn cũng cần Mock.

    Bạn sẽ cần hỏi người viết method, đọc docs hoặ code để xem sẽ có các kiểu data trả về như nào (Null, object,  object rỗng, thows lỗi…) để bạn viết các test Unit Test cho các trường hợp đó.

    Tất nhiên bạn cũng sẽ cần biết các lỗi của việc Call API và các dạng data trả về của API để thực hiện mock và viết Unit Test.

    Thông thườn dự án có Unit Test được viết chuẩn thì sẽ ít bug, tuy nhiên thời gian phát triển sẽ gấp 2 hoặc 3 lần. (Chi phí dev sẽ tăng)

     

    Automation test

    Dịch tiếng việt từ này là test tự động. Automation test thường được các tester biết viết code thực hiện làm. Với Automation test thì sẽ chú trọng test cả 1 tính năng hoàn chỉnh ( tính năng chạy full flow).

    Ví dụ một tính năng chuyển tiền, Automation test sẽ thực hiện test hiện full luồng chuyển tiền (Đăng nhập, chọn chức năng chuyển tiền, nhập thông tin người nhận tiền, xác nhận chuyển tiền, kiểm tra tiền đã chuyển thành công và người nhận tiền đã nhận được…).

    Có một lib huyền thoại của java để thực hiện việc này đó là selenium. Tuy nhiên hiện tại mọi người sử dụng Robot Framework nhiều hơn.

    `khi nào dùng unit test trong tình huống thực tế vậy ạ`

    Với câu hỏi này thì khi bạn hiểu các ý ở trên thì bạn sẽ trả lời được 1 cách đơn giản.

    Đó là khi bạn cần test các logic của từng Unit (Function, method) để xem code của chúng ta trong (Function, method) đã ngon chưa, đã cover được hết case chưa.

    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

You must login to add an answer.

Continue with Google
Continue with Facebook
or use


Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 554
  • Answers 1k
  • Best Answers 63
  • Users 291
  • Popular
  • Answers
  • monkey

    [Deep Learning] Làm thế nào để xác định được cái ...

    • 16 Answers
  • Tú Trần Anh

    [Ezyfox Server] Unity game client không gửi được command khi ...

    • 12 Answers
  • Thưởng Đặng Văn

    Multiple tenant multiple database .net core

    • 10 Answers
  • monkey
    monkey added an answer 1. Em có thể lưu dữ liệu tạm ở Local… May 25, 2022 at 4:52 am
  • Hoàng Kiếm
    Hoàng Kiếm added an answer Huy ơi bạn đã thử login bằng command, mysql -u… May 21, 2022 at 5:42 am
  • tvd12
    tvd12 added an answer public class EzyEventLoopGroup { private final EzyRoundRobin eventLoops; private final… May 19, 2022 at 2:20 pm

Related Questions

  • monkey

    Cách đặt một câu hỏi tốt!

    • 0 Answers
  • Nguyễn Thái Sơn

    cách update công nghệ mới khi có tuổi

    • 1 Answer
  • Nguyễn Thái Sơn

    serverless in the future

    • 1 Answer

Top Members

tvd12

tvd12

  • 63 Questions
  • 1k Points
Enlightened
monkey

monkey

  • 88 Questions
  • 588 Points
Enlightened
Nguyễn Thái Sơn

Nguyễn Thái Sơn

  • 140 Questions
  • 220 Points
Professional

Trending Tags

.net core abstract class analytics android ansible anti-flooding apache poi api async asyncawait atomicboolean backend backend nestjs bash script batch bean big project binding bitcoin blockchain blog british buffered build bundle c# cache caching callback career career path cast centos chat cloud cloud reliability commit company content-disposition contract cors cosmos css database datasource datastructure decentralized exchange deep learning design-pattern devops dex distraction programing docker download draw.io du học dữ liệu lớn eclip editor employee english erc20 erc721 eth ethereum ethereum login extensions exyfox ezyfox ezyfox-boot ezyfox-server ezyfoxserver ezyhttp facebook fe flutter freetank french front-end frontend fullstack fulltextsearch future game game-box game-room game-server get git go golang google grapql grpc guide hazelcast hibernate hibernateconfig html http https indexing intellij interface interview io ipfs isolate issue it java javacore java core javascript java spring javaw java web job jpa js json jsp & servlet jvm jwt kafka keep promise kerberos keycloak kotlin language languague library load-balancing log log4j log4j-core login lưu trữ machine learning macos math maven merge messaging metamask microservice model msgpack multiple tenant multithread multithreading mysql n naming naming convention netcore netty nft nft game nio nodejs non-blocking io opensource optimize orm pagination pancakeswap panic pgpool phỏng vấn pointer postgresql pre programming promise push message android python python unicode question queue rabbitmq reactive reactjs reactjs download recyclerview redis request resource rest roadmap ropssten ropsten rust rxjava schedule search security server shift jis singleton sjis slack smart contract socket soft delete sosanh spring spring-boot-test spring-jpa spring aop spring boot springboot spring data jpa spring redis spring security springsecurity sql sql server sse stackask storage stream structure trong spring boot system environment variables thread threadjava thymeleaf totp tracking location unit test unity upload file vector view volatile vue vue cli web3 web3 client webpack websocket windows 11 winforms work zookeeper

Footer

Stack Ask

Stack Ask is where Developers Ask & Answers. It will help you resolve any questions and connect you with other people.

About Us

  • Meet The Team
  • About Us
  • Contact Us

Legal Stuff

  • Terms of Service
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2021 Stack Ask. All Rights Reserved
Powered by youngmonkeys.org