« first day (2097 days earlier)      last day (2887 days later) » 

7:44 AM
@ThomasOwens as promised, pinging you to remind about this job-tags burnination request - you were going to take a look at it
 
 
4 hours later…
12:02 PM
I am writing a smtp server in c#
I am using the TcpClient's api to manage smtp transit
Via this api I am also able to track info of the remote host which is sending email...
Question is...if this server is behind a load-balanced setup, will I get the remote host info or will I get info of the load-balancer machine?
 
 
1 hour later…
1:17 PM
probably depends on how the thing is implemented.
 
This is more about the process of developing, than the development itself, so it should be asked in the Programmers StackExchangecricket_007 40 secs ago
 
 
2 hours later…
3:15 PM
hi
i am trying to create a testsuite for an application wherein I have created an abstract class as Test, which has an abstract method ExecuteTest()

This(abstract class Test) is extended by various tests to and ExecuteTest Is overridden to desired test

Now the issue is, i have numerous tests, which I feel can be combined.

The code looks like:
abstract class Test
{
public abstract ExecuteTest()
}

class TestScenario1:Test
{
override ExecuteTest()
{
common part A
code for test scenario 1
common part B
As you can see, i am have many classes(which represents TestScenarios)...
is there a better way to do this?
i am not sure if i can use delegates, as it would required all my methods to have same signature, whereas my caller, 'code for test scenario' has different signatures
 
in what language? I mean if you're in Java or C#, use the existing tools.
 
C#
existing tools?
 
MSTest. It has its own initialize and teardown stuff, nice asserts, built in visual studio support, etc,etc.
or if you somehow hate that, there's NUnit which works fine for not-unit tests and has a comparable feature set.
 
These are not unit tests, but AutomationTests, that i would need to run on my own app, and log results in my own db
 
or if you somehow hate that too, there are probably dozens of other frameworks.
MSTest isn't just for unit tests.
 
3:33 PM
also, i did the above because i created a TestPipeline, so i could add my tests as required,
Looks like
List<Test> pipeline=new Test{new TestScenario1(),TestScenario2()}
foreach(Test test in pipeline)
test.ExecuteTest()
 
3:55 PM
@MainMa: I wouldn't do that. It makes no sense to answer an off-topic question, on the off-chance that it might actually get migrated to the correct one. Most off-topic questions on Programmers get closed, not migrated. — Robert Harvey ♦ 40 secs ago
 
@RonakAgrawal so is there a reason you're reinventing the wheel for testing?
I know you've already invested some time into it since this isn't the first time you've asked about it, but I'm not sure you ever explained why you were trying to recreate a test running suite
I would think it would be easier to configure an existing test platform to put stuff into your DB than to recreate one from scratch
although I'll admit that I've had to do the latter
so I'm not saying you shouldn't under any circumstance, but you should have a good reason for doing so.
 
"Unit" test is a pretty horrible name. A method can be a unit. So can a class. Or a small number of closely related classes. Or a package. Or a library or application. I've been being philosophical and playing with jUnit to test an entire application by invoking a Main method with given arguments. However, main[] in Java is void and I haven't gotten over not being able to check return values. I'm sure there's a good way, though.
 
I prefer the term "automated testing" because the automation is the part that actually matters
whether you're doing 90% unit tests or 90% integration tests is nowhere near as important as having some kind of automated test suite
 
well, regardless of the name, you get what I'm going for
there is some recreation of well established, widely used code testing software, which is a code smell
 
Yeah. Definitely don't reinvent the wheel. Use an existing framework. You can probably make it do what you need to do fairly easily.
 
4:07 PM
interdependent tests are vile, and should be avoided at all costs.
 
4:18 PM
okay, a little more info,
i have a performance data collector that logs the performance of the application that i am testing
so my Test class has a data structure that holds this data; also there are parameters which define whether to upload logs or not
thats the reason i have a 'Test' class of my own, which is more inclined to application, rather in general sense of 'Test'
 
how thoroughly have you vetted existing libraries to support something like that?
AFAIK most of the Out of the box solutions support timing
 
well, i checked Unit Test framework with .Net
in any case, that would still have many classes as i currently right?
TestScenario1, TestScenario2, and so on..
 
yes, but the management of running the tests and catching exceptions and logging are all done for you
as well as integration with many tools and external frameworks for most of them (think jenkins, CI boxes, nightly builds, etc)
 
sure, i take a look and implement accordingly, thanks for that...
one more thing;
 
as well as fewer bugs
 
4:24 PM
i feel i am missing an abstraction in writing those scenarios
i am not sure if i am able to pinpoint that
 
@RobertHarvey: notice that I was among the persons who voted to migrate the question to StackOverflow. This being said, the fact that the question is off-topic on a site shouldn't prevent a user from answering the question even before it is migrated to the appropriate SE site. — MainMa 45 mins ago
>_<
 
I kind of see his point.
 
wrapped inside a class, because i cant figure out how to do when i have a list of methods, say M
foreach method in MethodList
CommonStepA
method
CommonStepB
 
that's some next level FGITW right there
 
every class I have is like a method call,,
 
4:28 PM
@RonakAgrawal most unit test suites provide @before and @after functionality to set up and clean up tests, respectively
you need to sit down and truly look at a popular framework - I'm willing to put money on the fact that most of your problems have already been solved
 
@ThomasOwens It's all fat and happy if the migration succeeds. Which it does not, most of the time.
 
@RonakAgrawal nunit.org <- give that a look
 
sure, i will check
even if i do a @before and @after, the point being that, i would loose the ability to iterate over each test and execute the test with single call
 
you don't call the tests
you just declare a set of tests
and the test runner finds them, runs them, and reports back
that's the whole point
Why do you need to iterate over them yourself?
 
well, i need the performance data of during that test execution
 
4:34 PM
most test runners will do that automatically for you
 
currently what i have is a out parameter of the performanceDataAccumulated
 
and return the performance data with the test results
 
i have a custom performance collector, thats the data i need
its not related to test time, if i was monitoring chrome, i would have data with number of HandleCounts chrome used, PrivateMemory, and CPU usage
 
class a {
  method1(String s) {
    //Do Stuff
  }

  method2(String s) {
    //Do other stuff
  }
}

class testA {

  @before
  setup() {
    // Setup your test somehow
  }

  @after
  cleanup() {
    // Clean up the mess your test made
  }

  @test
  testMethod1() {
    // Make sure this method works!
  }

  @test
  testMethod2(){
    // Make sure this method works!
  }

}
so with that example, thats all the code you would write
(depending on your chosen framework)
but it finds testMethod1 and testMethod2 on it's own, then it runs them, and reports failures and performance
 
is there a way i can define sequence here?
 
4:37 PM
the @before method will always be run before
the @after always after
and I'm pretty sure most test suites guarantee test order so testMethod1 gets run before testMethod2, but you shouldn't rely on that
that's a bad code smell
 
no, inside class A, is there a way i can define method1 to be executed after method2 or so..
 
the tests should be independent
if you have a hard time fitting your code tests into this kind of a format, I would hazard a guess that your code needs refactoring, rather than a different test suite.
 
okay, may be 'Test' is the wrong word..i should have used 'Action'
 
most people who have troubles fitting their code to a popular test suite actually have poor code rather than a poor test suite
 
the test suites normally just want a function to run, you can stuff whatever you want into that function, including iterating a million times and taking the average or whatever else you want to do for optimally accurate perf data
 
4:39 PM
^^
 
like my flow is, Startperf,LaunchApp,StopPerf;
StartPerf,Login,StopPerf
StartPerf,ClickButton1,StopPerf
StartPerf,ClickButton2,StopPerf
StartPerf,ClickButton1Again,StopPerf
 
are you testing via a web interface?
 
lets say the above flow is pipleLine1
 
its a standalone app that uses chromiuom
*chromium
 
4:41 PM
so your clickButton1Again test relies on clickbutton1 having been run first
which is bad
 
there is a pipeLine2 with flow,
StartPerf,Login,StopPErf
StartPerf,ClickButton2,StopPErf
StartPerf,ClickButto1,StopPerf
 
your tests should be independent and thus be able to be run standalone
so what you're calling a pipeLine should be a test
you can measure multiple metrics and test multiple things in one test (although it's not a great idea)
 
and the 'test' should be...
thats what is haunting me..i knew i was missing an abstraction
i could not figure out where
 
does it make more sense?
class a {
  login(String s) {
    //Do Stuff
  }

  clickButtonOne(String s) {
    //Do other stuff
  }
}

class testA {

  @before
  setup() {
    // Setup your test somehow
  }

  @after
  cleanup() {
    // Clean up the mess your test made
  }

  @test
  testOne() {
    // Make sure this method works!
    startPerfTimer()
    login()
    stopPerfTimer()
    startPerfTimer()
    clickButtonOne()
    stopPerfTimer()
    // Do other stuff
  }

  startPerfTimer() {

  }

  stopPerfTimer() {

  }
that's kind of an example of what you could do
again, this is isn't best practice, but I'd still argue that it's better than writing a test automation suite from scratch
another thing of note, both your "pipelineOne" and "pipelineTwo" are measuring the performance of login - that should really just be tested and measured once, in one place
right?
 
its like an individual block, so the performance changes, when the block is getting executed
so login for perf at a first launch would be different than at 2nd
 
4:48 PM
the login performance is different?
why?
you need to separate your tests.
 
the first login is just after the app isntallation
 
yeah, that's really bad
 
the second when the app was loaded with all api's and hence is faster
 
You should start all tests from the same spot
so your setup would be installing the app, and cleanup would be deleting it
if you want to test performance of login right after startup vs after first login, those should be seperate tests
each test should test one thing
right now pipeline one and pipeline two are testing like 3 things each
a failure on one could impact the failures of the other, and now you have no way of figuring out which one is the offender
 
its like, one block gives performance of only one unit; no more, no lesss
now , i just have to place these blocks in required order to check different scenarios
thats what i meant, its not 'TEst' but 'Action'
 
4:52 PM
yeah, that's something that people did and found was bad, for the reasons mentioned
 
the purpose of introducing pipeline is to monitor if and how performance varies with different application states
so the test is just doing one thing, testing 1 scenario
i mean logging perf for 1 scenario,
 
but it's not
it's logging performance of login right after server install, as well as button one perf, as well as button 2 per
then test 2 is doing login button after it's been run once, and button one perf and button 2 perf
let me ask you this - are you returning only one number after each pipeline is run?
or does the login performance get reported seperately from the button performance?
 
all seperate
at the end you would have 3 data sets, LoginPerfDataSet, Button1DataSet, Button2DataSet
 
so how can you claim that you're only testing one thing?
 
basically whenever we call stopPerf, the performance is logged out
 
5:00 PM
you should have a test class that only tests login performance - one test for right after install, one for after it's been called.
 
its an end to end test of a scenario..
 
then you should have a second test class that only tests button one perfromance
login would be a part of the setup for that test
becuase you've already tested it, you don't care
then you should be testing the whole performance piece if it's an end to end test, right?
but you're not, you're trying to test every little piece as you go
 
okay, makes sense
currently i have a class perfcollector, that collects performanceDatat
as i understand , i have a class LoginPerf, that would give me LoginPerf
then have Button1Perf, that would give me Buggon1Perf and so on..
and under this class, i have call to perfCollector.Start() or and perfCollector.Stop()
please correct if my understanding is wrong
 
class testLogin {

  Server s;

  @before
  setup() {
    // Initialize your server
    s = new Server();
  }

  @after
  cleanup() {
    // Delete your previous server
    s = null;
  }

  @test
  testFreshServer() {
    startPerfTimer()
    login()
    stopPerfTimer()
  }

  testNotFreshServer() {
    login()
    logout()
    startPerfTimer()
    login()
    stopPerfTimer()
  }

}

class testButtonOne {

  Server s;

  @before
  setup() {
    s = new server()
    // We no longer care about the performance of login! It's already tested and measured!
 
*have class Button1Perf that gives Button1Perf and so on
 
5:06 PM
take a look at that
note that testLogin and testButtonOne are seperate classes
and in testButtonOne, you only measure the performance of buttonOne
you can have another class testEndToEndPerformance that tests entire scenarios as a whole if you really want
but in that you should call startPerftimer() and stopPerfTimer() only once
at the beginning and end
you've tested each part individually so there's no need to test them all over again
 
wont that create too many classes..
that's what i am afraid off..
 
are you worried about writing too much code?
 
nope..
 
it's C#, not haskell
verbose is the name of the game for java and C#
yes, it's a lot of code
but the thing is that these tests are independent and easily repeatable
 
well, a class should be seggregation of similar operations
 
5:09 PM
nah, not test classes
test classes are just groups of tests
don't worry about SRP or any of that jazz
just make them make sense for you
if you test both button one and button two in one class, that's ok
especially if their setup and cleanup methods are the same
 
okay, great..that was i was worried about..thanks much
 
then you just have a testButton class
 
i think i was over-speculating with the number of classes, i l just update the NUnit or the VisualStudioUnitTest Framework
 
yeah, I've never used either, I just found NUnit on the web
whatever works best for your environment
I'm mainly java, which is similair
 
well.. .Net is JAVA
with a few keywords here and there
:D
 
5:13 PM
LOL don't tell oracle that!
 
thanks much for inputs
 
NP man
glad to be able to help!
 
Anyone know the answer to this?
118
Q: Super Mario Galaxy problem

JeffεSuppose Mario is walking on the surface of a planet. If he starts walking from a known location, in a fixed direction, for a predetermined distance, how quickly can we determine where he will stop? More formally, suppose we are given a convex polytope $P$ in 3-space, a starting point $s$ on t...

I got a 100 rep bounty on it and it's about to be wasted...
 
Say you have a choice of inheritance or not.. You could create an Animal class and then subclases with a bark method. so a Cat class, a Dog class, and Dog dog = new Dog(); dog.bark(); and it displays woof. Or, you could have just an animal class, it has a field for type of animal, and you set that, and when you set the animal.type, and do animal.bark(); it does the right bark. So, when is it better to use that, or when is it better to use inheritance?
also, is that question is too subjective for the main QnA site?
 
5:31 PM
I think it would be ok, but may have a dupe out there
@SirCumference looks like an interesting question for sure
 
Well its bounty is about to expire
 
(a bounty on a site I don't participate in)
did you really want the implementation beyond what the first answer gave?
 
@SirCumference You probably won't find many people here who can answer that question. I don't even know what a bunch of thsoe words mean.
 
6:03 PM
@barlop imo it's too broad, the serious answer to that is "nobody ever writes code like dog.bark();, show us what you're really working on" and only when we see what you're actually trying to accomplish can we tell if inheritance is a good fit
 
hello .. please i need help ... i need can protocol library api for stm32f discovery board .and i have no idea .. i wasted 2 days of googling and still dont know what to do ... please please help me
??? :(
 
have you tried asking the people at Software Recommendations? I wouldn't have a clue where to begin with that
 
no sir .. i am in big trouble i cant sleep well ... help if you have any idea about the api implementation pelase share :(
 
I really have absolutely no idea what you're after
 
please help if you know about can library ... i will me great help @Ampt @ThomasOwens @Ixrec sorry for tagging :(
 
6:14 PM
@user143252 We don't know what you are looking for. I have no idea what an STM32F discovery board even is. You should probably ask the manufacturer?
 
ok thanks
 
6:29 PM
@user143252 you want a CAN library for a specific board?
have you checked the manufacturer's website?
that's likely the only place you'll get one
which board, exactly, do you have
it looks like there are 17 active STM32F discovery boards
looked at a few and the chips don't provide native CAN support - meaning you're going to have to do the low level wiring yourself, which is a serious PITA
is this for a class or a job?
@Ixrec @ThomasOwens CAN is just another protocol like I2C or Serial for embedded systems. CAN just happens to be used a lot in automotive and industrial spaces
it's a very robust protocol, which is why people like it
 
(I know, we've had this exact conversation before)
 
Hmmmm maybe I need more coffee then.
 
@Ampt Is it like RS-422?
Or MIL-STD-1553?
I'm familiar with those, a little. Not at the driver level like some coworkers are. I do use 422 and 1553 drivers to communicate with devices.
 
Yes, it's a spec just like those
it's a little more loose with the physical layer
but the protocol is pretty well fleshed out
when I used it we also had CANOpen sitting on top of the CAN protocol, which provides more structure to the data, which was nice
A Controller Area Network (CAN bus) is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other in applications without a host computer. It is a message-based protocol, designed originally for multiplex electrical wiring within automobiles, but is also used in many other contexts. Development of the CAN bus started in 1983 at Robert Bosch GmbH. The protocol was officially released in 1986 at the Society of Automotive Engineers (SAE) conference in Detroit, Michigan. The first CAN controller chips, produced by Intel and Philips, came on the market in 1987...
The spec is on wikipedia
heh, if poor @user143252 has to implement that by hand he's so screwed.
I'm guessing this is for a class, in which case he probably has one of the chips with the CAN bus built in, and all he needs to do is configure the right registers and allocate a buffer for in and out messages
 
 
1 hour later…
8:02 PM
this is my project for diploma course .. and i have no idea how to deal with it.... i dont know how to implement the api for can , i already gone thorough the example code ... please guide me ... :(
 
@Telastyn sorry...but what thing were you referring to?
 
what now?
 
smtp server behind a load balancer...
you said it was all based on setup...
 
It probably depends on how the load balancer is written - at what layer it's working at. If it just forwards along the connection, then you might see the internal server. If it intercepts the connection and responds, you might not.
 
layers? as in osi layers?
 
 
1 hour later…
9:31 PM
hi is anyone here?
 
10:06 PM
3
Q: Comunicating between layers in DDD

user237329Reading the literature of DDD I came up with the following layers: Application Outsider World (Controllers, Crons, etc) Application Services (or UseCases) - which orchestrates multiple Domain Services or Infrastructure Services. They are called from Outside World. They know what things have to ...

Inexplicably, this question has a score of 3, even though it isn't clear at all what the OP wants.
@DonLarynx What's up?
 
I want to be a developer but there's too much negativity and it stops me
 
Oh, dear.
What is it about programming that makes you negative? Or are you just negative in general?
 
People keep comparing programming to corporate slavery for lack of a better name
 
that's...extreme
 
Don't listen to them. They're jaded Java programmers whose mothers spoiled them too much.
It isn't too hard to find prima donnas in any profession.
 
10:10 PM
I wouldn't still be programming if my job felt like slavery
 
It doesn't?
 
it does not
 
Your real challenges in software development are not going to be people who forgot to take their sandwich to work with them. Stop listening to those people and decide for yourself whether it is something you like or not.
 
I have flexible hours, plenty of vacation time, sick days, pension, insurance, health plans, a very competent and understanding manager, challenging and interesting work that I'm given a great deal of autonomy in approaching, lots of perfectly competent and amiable coworkers...really, there's nothing hellish about it at all
I might have lucked out a bit but there are good programming jobs in the world
especially if you're any good at it
whether you personally enjoy programming is the bigger question frankly
 
I do
 
10:15 PM
now if you'll excuse me, I have to watch Batman with the guys in the SFF.SE chatroom
 
This question may be a better fit on programmers.stackexchange.com - read their help page before posting it there though, and if you do post there, delete this question so you're not "cross-posting". — Blorgbeard 55 secs ago
 

« first day (2097 days earlier)      last day (2887 days later) »