Behavior
Behavior is the externally observable actions, responses, outputs, or effects of a system or object under specified conditions or interactions.
Unit Testing Principles, Practices, and Patterns
Observable behavior is the externally detectable functionality and outcome produced by software.
- How it is used
- Guides unit-test design toward externally visible outcomes and away from implementation coupling.
- How deep it goes
- Defines observable operations and state, contrasts APIs, and demonstrates encapsulation and refactoring consequences.
- Examples
- Uses user-name normalization, customer discounts, private price calculation, and dog behavior to distinguish outcomes from internal steps.
- What you can do after
- Apply it by writing black-box tests against client goals and refactoring leaked or overly complex implementation details.
Read how Unit Testing Principles, Practices, and Patterns explains behavior →
Get Programming: Learn to code with Python
An object behavior is an operation that defines how objects of a type can act or interact.
- How it is used
- Organizes object design by specifying the operations objects may perform independently or through interaction.
- How deep it goes
- Defines behaviors as operations and illustrates them with cars, circles, map points, rooms, classes, and methods.
- Examples
- Uses calculators, cats, cars, circles, map points, rooms, lists, numbers, and a queue to demonstrate operations.
- What you can do after
- Apply it via Python classes by choosing behaviors, implementing methods, creating objects, and performing operation sequences.
Read how Get Programming: Learn to code with Python explains behavior →
.NET MAUI in Action
Behavior is the part of user-interface logic that specifies what interface elements do in response to conditions or interaction.
- How it is used
- Defines UI actions and connects control events to ViewModel commands within MVVM-based interfaces.
- How deep it goes
- Defines behavior conceptually, then demonstrates attachment, event handling, command binding, and parameter passing.
- Examples
- Uses an animated label example and a to-do CheckBox that updates completion state through an event-to-command behavior.
- What you can do after
- Apply it via EventToCommandBehavior to extend controls and send event-triggered commands with custom parameters.
The Art of Unit Testing 3e
Behavior of software that can be detected through outputs, state changes, or other effects visible to an external observer.
- How it is used
- Guides unit tests toward effects relevant to end users instead of private implementation details.
- How deep it goes
- Defines observable behavior and applies it to assertions, test names, overspecification, and private-method decisions.
- Examples
- Uses verifyPassword with a failing rule to show a test name containing the unit, scenario, and expected result.
- What you can do after
- Evaluate tests for user-relevant behavior and write names and assertions that avoid unnecessary implementation coupling.
Related concepts
- state design patternused by · The State design pattern encapsulates state-specific behavior in separate representations and delegates an object's behavior according to its current state.
- atomic typepart of · An atomic type is a type whose supported accesses and operations are indivisible with respect to concurrent execution and provide defined synchronization semantics.
- alignment trainingconfigured by · Alignment training is the process of adjusting an AI system’s behavior to better conform to intended human goals, preferences, values, or constraints.
- parameterconfigured by · A model parameter is a numerical value, such as a weight or bias, that is learned or set to determine how a model computes outputs.
- EventToCommandBehaviorincludes · EventToCommandBehavior is a .NET MAUI behavior that invokes a command when a specified UI event occurs and can pass event-derived parameters.
- contractequivalent to · An API contract is a specification of the operations, data, and behavioral expectations that govern interactions between software components.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



