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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:26:59+00:00 2026-06-09T05:26:59+00:00

I have two gen_servers that communicate using gen_tcp sockets. The first gen_server exports a

  • 0

I have two gen_servers that communicate using gen_tcp sockets.

The first gen_server exports a function, that when called builds (calling another function) a RFC 791 packet, connects to a socket where the other gen_server is listening for incoming connections, and sends the packet to it.

I tested this in the shell and it is working, but what would be the right tool/way to test such a code? Should I use eunit or or is there any other tool more suitable?

Moreover I would like to know what should I actually test? Only the sending part or also function for packet construction?

  • 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-06-09T05:27:00+00:00Added an answer on June 9, 2026 at 5:27 am

    You can definitely write some EUnit tests for every gen_servers:

    http://www.erlang.org/doc/apps/eunit/chapter.html

    http://learnyousomeerlang.com/eunit#the-need-for-tests

    You can also have a look at Common Test to test the interaction:

    http://www.erlang.org/doc/apps/common_test/basics_chapter.html

    http://learnyousomeerlang.com/common-test-for-uncommon-tests#what-is-common-test

    Since your implementation strongly depends on the data passed, I would have a look to generators provided by QuickCheck Mini or PropEr:

    http://www.quviq.com/

    http://proper.softlab.ntua.gr/

    A brief explaination on how you can improve your unit tests with something like QuickCheck mini is available here:

    http://www.erlang-solutions.com/upload/docs/85/EUG-London-Apr2011.pdf

    As a start, I would focus on testing the functions you export (the module interface). You can still add more tests later.

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

Sidebar

Related Questions

I have two applications written in Java that communicate with each other using XML
I have two queries that find both the Zip codes, and the States for
Have two events: $('body').mouseup(function(e){} and $('.toggle').click(function(e){} I only want one of these to trigger.
I have the following function that I wrote function range_gen($num1,$num2){ $exp = explode('.',$num1); $accuracy
I have an Eclipse Plug-in that contains two source folders: src/ src-gen/ The reason
I have a gen_server module that logs data to a file when a client
I have two js files, both called by one HTML file. <script type=text/javascript src=scripts/levelmovement.js></script>
Have two folders with approx. 150 java property files. In a shell script, how
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two tables images2 and image_data So the goal is to have 1

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.