Automatically filling an app with test data

  • Hi everyone.
    I've finally come to the end of my app and now I need to test it with
    data. The test with some data generated manually goes weel, but now I
    have to fill the app with lots of data, to see how it behaves. Is
    there a common approach to doing this?

    I came across the Cocoa scripting guide, and it seems the way to go,
    but I wonder if it would not be better to write some code that fills
    automatically the app instead of going through the guide to learn how
    to make my app scriptable.

    I'm using core data to store all application data, so maybe there is a
    way I'm not considering.
    Thank you very much.
    Cheers.

    Matteo Manferdini.
    Pawn Software
    www.pawn-soft.com
  • On Wed, Dec 31, 2008 at 5:01 AM, Matteo Manferdini
    <mat.mailings...> wrote:
    > I've finally come to the end of my app and now I need to test it with
    > data. The test with some data generated manually goes weel, but now I
    > have to fill the app with lots of data, to see how it behaves. Is
    > there a common approach to doing this?

    You mean you have written an application and haven't been testing it
    throughout?  What do you plan to do when you have a rat's nest of
    interrelated issues that you can't address without going back and
    revamping your app's design?

    > I came across the Cocoa scripting guide, and it seems the way to go,
    > but I wonder if it would not be better to write some code that fills
    > automatically the app instead of going through the guide to learn how
    > to make my app scriptable.

    If you want to get data into your app, you might want to look at
    writing code to extract data from other sources, rather than starting
    with that data and trying to get it into your app.  After all, you're
    already writing your app's source code, you needn't treat it as a
    black box.

    > I'm using core data to store all application data, so maybe there is a
    > way I'm not considering.

    That would be an awfully generic problem to solve, wouldn't it?
    "Given a program P, which we know uses Core Data in some capacity but
    can do anything else beyond that, and an arbitrary set of test data T,
    import T into P in a useful manner."  Smells like the Halting Problem.
    ;-)

    --Kyle Sluder
  • On 2008 Dec, 31, at 23:19, Kyle Sluder wrote:

    > You mean you have written an application and haven't been testing it
    > throughout?

    Probable answer: Yes, life happens.  People have also been known to
    write applications without a detailed Test Plan in a detailed Software
    Specification.  :))

    On Wed, Dec 31, 2008 at 5:01 AM, Matteo Manferdini
    <mat.mailings...> wrote:

    > I came across the Cocoa scripting guide, and it seems the way to go,
    > but I wonder if it would not be better to write some code that fills
    > automatically the app instead of going through the guide to learn how
    > to make my app scriptable.

    If you have plans to make your app scriptable someday, and your
    release schedule allows it, then, sure, consider making it scriptable
    now and use it to test -- I've dreamed of doing this.

    Or use Kyle's idea of writing some kind of importer.

    Although Unit Testing is not geared toward initial testing a new
    application, since you had enough time to ask the question, reading
    through this would probably help your decision-making process:

    http://developer.apple.com/tools/unittest.html

    Like Kyle said, there is no "correct" answer.  It depends on your
    situation.  Just don't throw it over the cubicle wall to the Test
    Department.
  • > You mean you have written an application and haven't been testing it
    > throughout?

    Of course I've done it, it would have been foolish to write an app
    without any test! :) What I need now is a rapid way to fill it with
    tons of data, the data a user could accumulate in a year or two of
    use, to see if there are problems that cannot be spotted with few
    entries by hand (i.e. if the application slows too much and needs some
    optimization). Doing this by hand would be very long, so I'm looking
    for the best/most rapid way of doing it.

    > If you want to get data into your app, you might want to look at
    > writing code to extract data from other sources, rather than starting
    > with that data and trying to get it into your app.  After all, you're
    > already writing your app's source code, you needn't treat it as a
    > black box.

    The problem is that I do not have any external source of data. My app
    is a diet app a user fills constantly with personal data. So I need
    some sort of automatic procedure to generate random data. I can
    obviously write an object to do it. I was only asking if this is the
    usual way or if there is some other better way of doing it.

    >
    >> I'm using core data to store all application data, so maybe there is a
    >> way I'm not considering.
    >
    > That would be an awfully generic problem to solve, wouldn't it?
    > "Given a program P, which we know uses Core Data in some capacity but
    > can do anything else beyond that, and an arbitrary set of test data T,
    > import T into P in a useful manner."  Smells like the Halting Problem.

    Yes, I admit it was a very generic way of describing the problem. What
    I meant was: is there some way to automate the filling of a core data
    based application, given the core data model? What I'm looking for is
    some tool that reads the model of my app, takes some range for the
    values of attributes and generates a bulk of data my app can read. I
    don't know if there is something like this, but it could be a very
    handy way to solve my problem.

    Thank you very much.
    Cheers.

    Matteo Manferdini
    Pawn Software
    www.pawn-soft.com
  • > What I'm looking for is
    > some tool that reads the model of my app, takes some range for the
    > values of attributes and generates a bulk of data my app can read.

    I know of no such thing, but just wanted to comment that it sounds like a
    very useful utility--perhaps someone should create such a thing ;-)

    --
    Scott Ribe
    <scott_ribe...>
    http://www.killerbytes.com/
    (303) 722-0567 voice