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

  • Home
  • SEARCH
  • 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

i'm building an app that will display some newsletters to the users. the newsletters
There are two projects: 1) applet project that outputs jar file 2) web app
Part of my app caches web pages for offline viewing. To do that, I
Writing a 4-player iPhone game app with programmable mix of human/autoComputer players. After each
I generally use will_paginate for the pagination in my app, but have hit a
We have Best practices on using disposable object in SharePoint. But i`m thinking -
So far I have worked in the console and a few days ago decided
Apologies for the somewhat unclear question - couldn't think of a better way of
I'm a newbie to iphone development and I've been struggling with an EXC_BAD_ACCESS error
First let's look at the utility class (most javadoc has been removed to simply

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.