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

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

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

You must login to ask a question.

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

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

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

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3615842
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:25:26+00:00 2026-05-18T22:25:26+00:00

I finished an app and after that I’m trying to write unit test to

  • 0

I finished an app and after that I’m trying to write unit test to cover all methods.

The thing is that I’m seeing that I’m testing my code with the knowledge of how it works.

For me it is a bit stupid because I know how the code works and I’m testing what my code is actually doing.

Is this useless? I’m testing what it does, not what it’s supposed to do. My code works but I can improve it. Then:

Should I complete all my tests and then try to refactor my code changing my test to "How the code should work" and making the changes to the app to pass the test?

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

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:25:26+00:00Added an answer on May 18, 2026 at 10:25 pm

    You need to test “How the code should work”. That is, you have a clear idea of what a particular method should behave like, then create the set of tests that covers that behaviour. If your code fails the test then you can fix it.

    Even though your code is working now you still need the tests for regression testing. Later when you modify your code or add new extensions to it you need to ensure that you did not break the existing functionality. The set of tests that you derive today will be able to tell you how well you did.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While i finished developing an in-app-purchase application, and after several testing on iPad/Iphone, every
I'm trying to write an app that uploads videos from Android phones as they
I finished building an app that allows beaming of photos, contacts and text clips
Almost finished my java web app. All working fine. Whats next. I need now
I wrote a test app that should never stop. It issues t.wait() ( t
I have an application that is finished except for the problem i am trying
I have created a web app that is almost finished. I need it to
I have functions I want to perform after my app has finished initialising and
I am trying to test my app on an iPhone 4S. When I build
Running my finished Rails Tutorial app through Rails Best Practices got me a warning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.