Elektrine
Log in Register
Paige Chat Timeline Gallery Friends Email Drive DNS Private DNS Domains VPN Kairo Nerve
Remote

Jeff Martin

@custommonkey@fosstodon.org
mastodon 4.7.3
  • Open on fosstodon.org
0 Followers
0 Following
4 Posts
Joined December 23, 2022
Open post
Jeff Martin @custommonkey@fosstodon.org
· 3w ago
Replying to
@NicolasRinaudo@functional.cafe @danicheg@indieweb.social Mocks should only be mocking behaviour not data. It’s unnecessary and undermines the value of mocking as a technique which exposes behaviours. The presence of multiple mocks should be taken as a signal that the code is encapsulating more behaviours than it should and should be refactored to reduce the number of required mocks / implementation concerns.
0
1
0
0
Open post
Jeff Martin @custommonkey@fosstodon.org
· 3w ago
Replying to
@NicolasRinaudo@functional.cafe @danicheg@indieweb.social Which is entirely unnecessary. Either the value has some effect on the outcome of the procedure in which case we assert something about the relationship between the value and the output. Or it doesn’t and it’s existence is redundant. Or it’s used in a side effect and that’s the code which should have been mocked or better factored out. We’ve ignored the signal that having this type of mock is telling us about the design of the code.
0
1
0
0
Open post
Jeff Martin @custommonkey@fosstodon.org
· 3w ago
Replying to
@NicolasRinaudo@functional.cafe @danicheg@indieweb.social you shouldn’t it’s because people are lazy and don’t understand side effects. It’s not a mocking problem, it’s a mocking done badly problem. The point of mocking is to say “how can I refactor my code so that this mock is redundant” rather than how can I use a mock to paper over poor design. I do think that newer mocking libraries have made this problem worse by enabling bad practice as a feature, but I don’t think that the problem is mocks rather than their misuse.
0
1
0
0
Open post
Jeff Martin @custommonkey@fosstodon.org
· 3w ago
Replying to
@danicheg@indieweb.social @NicolasRinaudo@functional.cafe I don’t think that’s a helpful position. It’s semantic slight of hand. What’s the definition of a stub vs a fake vs a mock. Why is stubbing (whatever that is) data better than mocking data? Use random or example data rather than some partial magic implementation of it. If your data model is so complex that you can’t easily define it for testing I’d question its monolithic structure.
0
1
0
0
Back
313k7r1n3
Elektrine

Tor hidden service

elekhj7afj4qnrr4yd3bkzslsyo5jgfxw3orgjkhlcxifueodybyiiad.onion

I2P eepsite

j6b6cyk6gjmepjih7jjadxgxvvf3lzzujljuu2v4biemzpg3naya.b32.i2p

Platform

  • Email
  • Chat
  • Timeline
  • VPN
  • DNS

Company

  • About
  • Contact
  • FAQ
  • Lite (no JS)

Legal

  • Terms of Service
  • Privacy Policy
  • Transparency Report
  • Report Abuse
  • Warrant Canary
  • VPN Policy

Support

  • support@elektrine.com
  • Report Security Issue
Mail client setup IMAP mail.elektrine.com:993 POP3 mail.elektrine.com:995 SMTP mail.elektrine.com:465
© 2026 Elektrine. All rights reserved. Server: 04:03:40 UTC