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 7577397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:10:31+00:00 2026-05-30T17:10:31+00:00

I’m developing custom serializer as hobby project and I would like learn the TDD

  • 0

I’m developing custom serializer as hobby project and I would like learn the TDD on it.

I have a tests for serialization & deserialization simple object graphs.
Now I want test some complex graphs with non-trivial deserialization (i.e. classes with no parameterless constructor, cyclic references, large amount of objects, etc …).

I need test the “building” and “extracting” graph of serialization and I need test the serialization & deserialization of created graph. I would like test all four actions with several graph (from simple over complex to super-complex graphs).

Should I create some non-Test class providing the predefined graphs for all tests or every test should have own source of graphs?

I’m asking this question because I see possible problem with dependecny several tests on one clas (the provider of graphs).

Thanks.

  • 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-30T17:10:32+00:00Added an answer on May 30, 2026 at 5:10 pm

    There’s not necessarily a “right” answer here; it depends on your project and your tests. It seems to be a good idea to have a common source of graphs – not necessarily a single class but maybe a set of classes (i.e. a graph factory/repository) that could generate graphs representing different concepts (the class lacking parameterless constructor, cyclic references etc).

    This doesn’t avoid the risk of having multiple tests relying on a common source but you need to weigh that against the cost of defining the construction of each graph. You could end up with a lot of duplicated code across tests. If there is benefit to re-using a given graph definition; the graph factory may be the way forward.

    One idea may be to have a meta-test/set of meta-tests against each graph so that you can confirm the graph validity. The point being that if a set of actual tests that all consume the same graph are suddenly failing you look to the meta-tests first and ensure that they are passing. The tests that you are planning should each be focussing on a single aspect (build/extract etc) and those tests can then rely on the graph validity.

    The key thing is to keep each test as simple as possible so that if/when it fails its obvious why its failing – by having graph construction elsewhere (and separately validating it) you can have your serialization tests focussing on that and that alone.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to run a str_replace or preg_replace which looks for certain words
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.