Paolo Masci
email: masci@isti.cnr.it

Marco Martinucci
email: martinucci@isti.cnr.it

Felicita Di Giandomenico
email: digiandomenico@isti.cnr.it

Towards Automated Dependability Analysis of Dynamically Connected Systems

Keywords: Stochastic modelling, autonomous systems interoperation, automated dependability analysis

Dynamic environments may include autonomous and decentralised components that pose many challenges from the point of view of interoperability, thus triggering research studies in several directions. One recent research direction explores the automatic composition of heterogeneous systems through connectors synthesised at run-time. Besides functional properties, such connectors generally need to satisfy also non-functional (dependability-related) properties. This paper investigates the definition of an automated procedure to support the synthesis of dependable connectors.

I. INTRODUCTION

Ubiquitous computing refers to a vision of technology where devices are seamlessly integrated in the environment and everyone benefits from their services without even being aware of their presence [START_REF] Weiser | The computer for the twenty-first century[END_REF]. In such a vision, complex and pervasive systems are expected to be composed of autonomous and decentralised components that cooperate and require services on the basis of specific needs. Pervasive systems may evolve along time, rely on heterogeneous communication protocols, and dynamically establish communication at run-time. The fast pace at which technology evolves continuously undermines the effectiveness of such systems because ubiquitous systems components need to exchange information and this ability is generally linked to the level of interoperability of their underlying technologies.

Among the current studies addressing the issue of interoperability of the next generation systems, the European Project CONNECT [START_REF]EU FP7 Project CONNECT (FP7-231167[END_REF] targets the dynamic synthesis of connectors via which networked systems communicate. The resulting emergent connectors compose and adapt interaction protocols run by the networked systems. The dynamic synthesis of connectors relies on activities related to discovery, learning, dependability [START_REF] Avizienis | Basic concepts and taxonomy of dependable and secure computing[END_REF] and performance analysis: interaction protocols are, in general, not known a priori, and both functional and non-functional properties must be taken into account in order to synthesise a proper connector.

In this work, we report on the research we are undertaking towards the development of a Dependability unit that implements an automated dependability and performance analysis to support the synthesis of connectors. The unit employs a stochastic model-based analysis, which shows appropriate to support design decisions during connector synthesis. In the remainder of the paper, like in the title, we will use the term "dependability" as a label that includes both dependability and performance attributes.

The paper is organised as follows. Section II summarises the main aspects of our reference framework, which includes the units for Discovery/Learning, Synthesis, Dependability, and Monitoring. The architectural structure of the Dependability unit is introduced in Section III. A case study on a distributed and heterogeneous marketplace application is presented in Section IV. The final considerations and conclusions are drawn in Sections V and VI.

II. REFERENCE FRAMEWORK

Following the approach taken in the CONNECT Project, which is general and well suited for addressing interoperability in the context of complex pervasive systems, we consider a reference framework with four logical units: Discovery/Learning, Synthesis, Dependability and Monitoring.

Discovery/Learning: This unit gathers information on the networked systems. Specifically, the unit discovers mutually interested networked systems, and retrieves information on the specification of the interfaces of the networked systems. The unit assumes that networked systems are discovery enabled, i.e., they provide a minimal description of their intent and functionalities. In the case a partial behaviour description is provided, the unit completes the specification through a learning procedure (e.g., via model-based testing).

Synthesis: This unit performs the dynamic synthesis of mediating connectors to enable interoperation among networked systems willing to interact. The unit uses the behavioural models built by Discovery/Learning to identify mismatches between the communication protocols employed by the networked systems, generates a connector that resolves such incompatibilities and deploys the connector.

Dependability: This unit supports the Synthesis unit in the definition of a connector that enables networked systems to interact with a given dependability level. Specifically, the unit executes a stochastic model-based quantitative analysis to determine if the connected system can meet the required dependability level. Furthermore, in the case the requirements are not satisfied, the Dependability unit reports possible enhancements to Synthesis.

Monitoring: This unit becomes operational when the connector is deployed. The unit continuously monitors the connector to update the functional and non-functional specification of the connector with run-time data.

In the Connect framework, a networked system broadcasts a connect request whenever a new connection to a service is needed. The connect request contains a description of the requested service together with a specification of the required dependability level for the service. When Discovery/Learning detects a connect request, the unit searches the networked systems that can provide the requested service. If such systems are found and operate a communication protocol different from that of the networked system that made the connect request, Discovery/Learning activates Synthesis to generate a suitable connector that enables interoperation. The Synthesis unit, on the basis of the specification of the communication protocols, produces a mediating connector. Before connector deployment, Synthesis activates the Dependability unit to evaluate if the connected system that will be obtained satisfies the non-functional requirements expressed by the networked systems. Once the connector is deployed, its run-time behaviour is observed by the Monitoring unit and notified to other units according to their needs, to properly account for dynamic system changes.

In this work, we elaborate on the Dependability unit. A Dependability-centric view of the input-output relations between the Dependability unit and the other units is shown in Figure 1: Discovery/Learning provides the dependability requirements; Synthesis provides the specification of the connected system, and possibly requests a dependability enhancement; Monitoring provides run-time statistical data on the execution of the deployed connector. The dependability assessment and the enhancements determined by the Dependability unit are used by Synthesis.

III. ARCHITECTURE OF THE DEPENDABILITY UNIT

The Dependability unit is logically split into four main functional modules (see Figure 2): Builder, Analyser, Evaluator and Enhancer. The Builder module derives the dependability model of the CONNECTed system from the specification provided by Synthesis. The Analyser module uses the generated dependability model to perform a quantitative assessment of the non-functional requirements reported by the Discovery Unit. The Evaluator module checks the analysis results to determine if the non-functional requirements are met. If the requirements are not satisfied, the Evaluator activates the Enhancer module to determine possible solutions to improve the dependability level of the CONNECTed system, e.g., use an updated specification that takes into account an alternative connector deployment or enhance the connector specification with ad hoc dependability mechanisms. If the requirements are satisfied, the Evaluator reports to Synthesis that the CONNECTor can be successfully deployed, and reports to the Monitoring Unit the aspects that must be observed for the CONNECTor that is going to be deployed, e.g., transition durations and probability of transitions failure.

In the following, we provide more details on the functionalities of the modules of the Dependability unit, and report on a prototype implementation, denominated DEA (DEpendability Analyser) of the Dependability unit based on the Möbius [START_REF]Mobius tool[END_REF] analysis tool.

A. Builder

The Builder module takes in input the specification of the connected system from Synthesis, and the dependability requirements from Discovery/Learning. The specification includes the nominal behaviour of the connected system, i.e., in fault-free situations, and the exceptional conditions, i.e., the failure modes. The module produces in output a dependability model of the connected system that contains enough details to assess the given dependability requirements.

Specification of the connected system: With reference to recent works on synthesis of mediating connectors [START_REF] Spalazzese | Mediating connector patterns for components interoperability[END_REF] and automata discovery/learning [START_REF] Raffelt | Learnlib: a library for automata learning and experimentation[END_REF], the specification of the connected system is given with Labelled Transition Systems (LTSs) annotated with non-functional information necessary to build the dependability model of the connected system. An LTS is an abstract machine that represents the sequence of actions performed by the system. Formally, an LTS is a tuple (S, S 0 , L, T ), where S is a set of states, S 0 ∈ S is a set of initial states, L is a set of labels, and T ⊆ S ×L×S is a transition relation. Annotations include, for each labelled transition, the following fields: time to complete, firing probability, failure mode, and failure probability.

Dependability requirements: Typical requirements that need to be satisfied are related with availability, reliability, performance and their combination. In our architecture, the dependability requirements provided by the networked systems are translated by Discovery/Learning into metrics and guarantees. Metrics are arithmetic expressions that describe how to obtain a quantitative assessment of the properties of interest of the connected system. In this context, metrics are expressed in terms of transitions and states of the LTS specification of the networked systems. Guarantees are boolean expressions that are required to be satisfied on the metrics under a set of constraints.

Dependability model: The dependability model of the connected system is specified with a formalism that allows to describe complex systems that have probabilistic behaviour, e.g., stochastic processes.

Implementation: The prototype implementation of the Builder module takes in input the LTS of the connected system described with Finite State Processes (FSP) [START_REF] Magee | Concurrency: state models & Java programs[END_REF]. The dependability model of the system is specified with Stochastic Activity Networks (SANs), a generalisation of Stochastic Petri Nets introduced in [START_REF] Movaghar | Performability modelling with stochastic activity networks[END_REF] and formally defined in [START_REF] Sanders | Stochastic activity networks: formal definitions and concepts[END_REF]. The SAN model is obtained from the LTS model by using the theory of regions [START_REF] Ehrenfeucht | Partial (set) 2-structures. Part I: basic notions and the representation problem[END_REF]. A region identifies a set of states in the LTS such that all transitions with the same label either enter, exit, or never cross the boundary of the region. Each region in the LTS corresponds to a place in the derived SAN model, and each labelled transition in the LTS corresponds to an activity in the SAN model. A similar approach has already been used in other works to translate LTSs into Petri Nets (see, for instance, [START_REF] Cortadella | Deriving petri nets from finite transition systems[END_REF], [START_REF] Buy | Toward efficient algorithms for generating compact petri nets from labeled transition systems[END_REF] and [START_REF] Carmona | Genet: A tool for the synthesis and mining of petri nets[END_REF]). In our approach, in order to have a well-defined probabilistic model, non-deterministic choices among k transitions outgoing from an LTS state are mapped in the SAN model into instantaneous activities with k case probabilities. The metric is an arithmetic expression that may contain a predefined set of functions (see Table I for some examples). The guarantee is given by a boolean expression on the metric and a set of constraints on the connected system model (e.g., constraints on the time frame of evaluation of the metric and constraints on the behaviour of the networked systems). Statistical operators (e.g., mean and variance), comparison and logical operators can be used in the expression. In order to uniquely identify states and transitions of the metric expression that appear in the generated SAN model, renaming is used to constrain the definition of the LTS regions.

1) Analyser: The Analyser module takes in input the dependability model from the Builder module and the dependability requirements from Discovery/Learning. The module builds a reward model, i.e., a model that enables a quantitative assessment of the metrics of interest, and makes use of a solver engine to obtain a quantitative assessment of the dependability metrics.

Reward model: The reward model is the dependability model extended with reward functions. Reward functions allow to specify properties of interest: they return a value depending on the system state, and can be evaluated either at an instant of time or accumulated over a time frame.

Solver: The solver evaluates the reward functions defined in the reward model. The evaluation can be performed either with analytical approaches or with simulation. Analytical approaches are based on state space analysis, and they are applicable when the model does not face state space explosion and when timing information follow deterministic or exponential distributions. Simulation, on the other hand, is always applicable (unless extremely rare events have to be evaluated), and is expected to be particularly useful when a tradeoff between accuracy and time to perform the assessment is needed.

Implementation: The prototype implementation of the Analyser is based on Möbius [START_REF]Mobius tool[END_REF], a popular software tool that provides a comprehensive framework for model-based evaluation of dependability and performance aspects of systems. The framework supports, among others, the SAN formalism. In Möbius, each reward function is a C++ function that returns a value depending on the marking of the SAN. There are two kinds of reward functions: rate rewards and impulse rewards. Rate rewards are used to implement time-based reward functions. Impulse rewards are used to implement action-based reward functions, i.e., they are associated with specific activities and can be evaluated only when the associated activity completes. The reward functions are automatically derived from the metrics expression as follows: the metric is mapped into its syntax tree to decompose the metric into a combination of basic functions; the basic functions are translated into C++ functions by using a predefined repository of function templates. For instance, with reference to the functions shown in Table I, a rate reward template is used to translate timeF rame(s), while an impulse reward template is used to translate #(tr, t1, t2). The content of the repository of function templates is not shown in this work, but some details will be provided in the case study shown in Section IV. The Solver evaluates the reward functions via simulation. The quantitative assessment of the metric is obtained from the assessment of the reward functions by merging the results according to the arithmetic operations specified in the syntax tree of the metric expression.

B. Evaluator

The Evaluator reports to Synthesis if the connected system satisfies the dependability requirements provided by Discovery/Learning. In the case of requirements mismatch, the Evaluator sends a warning message to Synthesis, and may receive a request to evaluate if enhancements can be applied to improve the dependability level of the connected system.

Requirements mismatch: If the requirements are not satisfied, the Evaluator may receive a request to explore one of the following three directions for improvements.

(1.) Update the specification of the connector to take into account an alternative connector deployment (e.g., a deployment with lower failure rate). Upon receiving this request, the Evaluator triggers a new analysis that considers the updated specification of the connector.

(2.) Enhance the specification of the connector by including dependability mechanisms (e.g., a message retransmission technique). Upon receiving this request, the Evaluator triggers a sensitivity analysis whose objective is to understand which failure modes of the connected system have highest impact on the dependability measure. Such failure modes will be the first ones to be considered for devising appropriate counter-measures capable of limiting the failure effects. To this end, the Evaluator builds a sensitivity analysis campaign to instruct the Builder module on the creation of dependability model variants, each of which considers a specific subset of failure modes (among those foreseen). Whenever a variant is generated, the Analyser module performs the assessment of the metrics on the generated model. The Evaluator collects the analysis results and, after all variants have been analysed, produces a ranking of the failure modes. This ranking is used by the Evaluator to iteratively activate the Enhancer module as long as either the guarantees are satisfied, or the Enhancer signals that all possible dependability mechanisms have been explored.

(3.) Apply a combination of the previously mentioned enhancements.

Implementation: The Evaluator compares the analysis results against the guarantees specified in the requirements, and reports a message containing a boolean value to Synthesis. The Evaluator may receive from Synthesis the following three types of enhancement requests: alternative deployment: upon receiving this request, the Evaluator triggers a new analysis that considers the updated annotated LTS specification of the connector contained in the request. dependability mechanism: upon receiving this request, the Evaluator triggers a sensitivity analysis that considers the impact of one failure mode at a time. Specifically, for each failure mode, a variant of the SAN models is generated such that the considered failure mode is the only one considered in the model. The ranking of the failure modes is obtained by assessing the metrics on the generated variants: the higher the impact on the guarantees dissatisfaction, the higher the ranking of the failure mode. combined enhancement: a request that allows a combined use of the previously mentioned enhancements. The combined enhancement request contains the annotated LTS spec-ification of the connector for the alternative deployment, and an indication that the Evaluator module should also enable the evaluation of dependability mechanisms to improve the connector. A field in the request is used to specify if the enhancements should be evaluated individually and/or in combination. When evaluated individually, an evaluation ordering is also provided.

C. Enhancer

The Enhancer is activated by the Evaluator when the guarantees are not satisfied and Synthesis makes a request to enhance the connector with dependability mechanisms. The Enhancer is instructed by the Evaluator module on the requirements mismatch and the failure mode that needs to be tackled. Specifically, the Enhancer performs the following actions: (i) selects a dependability mechanism that can be employed, among those available, to contrast the failure mode indicated by the Evaluator module; (ii) if all possible applications of dependability mechanisms have already been explored without success, the Enhancer sends a warning message to the Evaluator module; otherwise, the Enhancer instructs the Builder module on the application of the selected dependability mechanism in the connected system model and triggers a new analysis.

Dependability mechanisms: Dependability mechanisms are counter-measures that can be adopted to contrast failure modes. Typically, dependability mechanisms are based on the application of redundancy, e.g., duplication of system channels, or retry of message transmissions over system channels. The dependability mechanism, in this context, will be embedded in the synthesised connector, because networked systems are not under the control of the framework. Nevertheless, the dependability mechanisms embedded in the connector can be employed to improve, to some extent, the dependability level of the networked systems. For example, the reliability level of a transmission performed by a networked system can be improved through timeouts or message retransmissions applied at the connector level.

Implementation: The dependability mechanism suitable to contrast a given failure mode is determined through an ontology of dependability mechanisms, such as that reported in [START_REF]EU project ReSIST: Resilience for Survivability in IST[END_REF]. A detailed discussion on the content of the ontology is out of the scope of this paper. We developed ad hoc dependability models for a set of relevant dependability mechanisms, and a set of rules to automate the application of the mechanisms in the SAN model of the connected system. The ad hoc models can be parametric; for instance, a retransmission mechanism is parametric with respect to the maximum number of allowed retransmissions. As an example of mechanism and application rule, in Figure 3 we graphically show a retransmission mechanism and how to modify the original model in order to apply message retransmissions to a send operation. Specifically, the original model contains a timed activity send that models the send operation, an input gate send_cond that specifies the enabling condition of the activity, and two output gates, send_success and send_fail, that specify the output functions in the case of correct and faulty behaviour. The enhanced model is obtained from the original model by adding the following elements: a place send_count, with initial marking the maximum allowed number of retransmissions; an output gate send_count_reset, which resets the marking of send_count to its initial value when the send succeeds; an output gate send_retry, which reactivates send as long as send_count contains tokens, and resets the marking of send_count after performing all retransmission attempts.

IV. CASE STUDY

In this section, we show in detail the operations performed by the modules of the Dependability unit to support the synthesis of a dependable connector in a simple case study based on a distributed marketplace with heterogeneous networked systems. In the considered scenario, consumers need to interoperate with merchants to purchase products. Consumers and merchants have heterogeneous devices. In the general case, each merchant and each consumer may use a different protocol. Without loss of generality, in this case study we assume that all merchants have the same protocol P 1, and that all consumers have the same protocol P 2 (P 2 = P 1).

A. System Specification

The consumer follows a tuple space protocol, e.g., LIME [START_REF] Murphy | Lime: A coordination model and middleware supporting mobility of hosts and agents[END_REF], in which communication is obtained by reading and writing tuples onto a shared space. The LIME consumer starts the interaction by writing a browse request (tpListBrowse) in the tuple space to check the availability of a certain product. After reading the response (tpListResp) from the tuple space, the consumer either restarts the interaction (restart), or writes a purchase request (tpBuyReq) and then reads the confirmation of successful transaction (tpBuyResp).

The merchant follows a message passing protocol, e.g., SOAP [START_REF] Gudgin | Soap version 1.2 part 2: Adjuncts[END_REF]. In the SOAP protocol, the consumer starts the interaction with a discovery phase (spSearch). After receiving all responses (spResp) from the available merchants, the consumer either directly sends a purchase request to a merchant (spBuyReq), or starts a new discovery phase.

The synthesised connector is generated according to the algorithm reported in [START_REF] Spalazzese | Mediating connector patterns for components interoperability[END_REF], and enables interaction between one consumer and many merchants. Specifically, a tpListBrowse from a consumer is translated into a multicast spSearch directed to all merchants; the spResps from the available merchants are collected and translated into a single tpListResp; a tpBuyReq from a consumer is translated into an spBuyReq followed by a tpBuyResp.

The LTSs of consumer, merchant and connector are shown in Figure 4. The LTS of the connected system is obtained as the parallel composition of the LTSs of consumers, connectors and merchants. We consider the case in which the number of consumers (merchants) ranges over [1, 100] ({1, 3, 5}). The complete FSP specification of the system is reported in [START_REF] Masci | Towards automated dependability analysis of dinamically CONNECTed systems[END_REF].

Annotations: All transitions are exponentially distributed, and have a rate equal to one message per second. The probability that the consumer restarts the communication is P restart . The failure mode of a transition associated with any send (spSearch, tpListResp, spBuyReq and tpBuyResp) and any receive (tpListBrowse, spResp, tpBuyReq) action performed by the connector is message omission. The omission probability of the transition is linked to the number of devices using the channel at the same time. Consumers and merchants use different channels, and we consider an exponential relation between the omission probability and the number of devices that use the channel. Taking into account recent works that analyse failure probability in heterogeneous scenarios, e.g., [START_REF] Masci | Dependability analysis of diffusion protocols in wireless networks with heterogeneous node capabilities[END_REF], we assume that the omission probability for consumers results in the interval [0.7, 0.85], while for merchants results in the interval [0.92, 0.96].

B. Dependability Requirements

The metric is Service Discovery Ratio (SDR), which gives the mean probability for a consumer to successfully complete a purchase transaction with a merchant in a given time frame. The metric is specified in terms of networked system transitions as follows:

SDR(t1, t2) = #((S3, tpBuyResp, S0), t1, t2) #((S0, tpListBrowse, S1), t1, t2)
. The guarantee on the metric is mean(SDR(0, 200)) ≥ 0.7. The constraints are: (i) the consumer performs only one, fault-free, tpListBrowse request during the time frame [0, 200], and (ii) a product is purchased after the consumer has successfully checked the availability of a merchant. These constraints can be expressed by the conjunction of the following conditions on the consumer LTS: the tpListBrowse request completes exactly once during the time frame [0, 200], i.e., #((S0, tpListBrowse, S1), 0, 200) = 1, the connector correctly receives the request, i.e., P (f ail(S0, tpListBrowse, S1) | f ire(S0, tpListBrowse, S1)) = 0, and the consumer does not restart the transaction, i.e., P (f ire(S2, restart, S0)) = 0.

C. Automated Dependability Analysis

Dependability Model: The SAN model automatically generated by the Builder module has a timed activity for each labelled transition in the LTS. All activities have two case probabilities: case 1 is associated to the correct behaviour, while case 2 models the omission failure specified in the annotations. In order to show a human-readable model, in Figure 5(a) we show the LTS model in the case of one consumer and two merchants, and in Figure 5 Dependability Assessment: The generated reward model is evaluated via simulation. Connected systems with different number of consumers (c) and merchants (m) are considered, according to the provided specification (c ∈ [START_REF] Ehrenfeucht | Partial (set) 2-structures. Part I: basic notions and the representation problem[END_REF]100] and m ∈ {1, 3, 5}). In Figure 6(a), we show the threshold specified in the requirements (70%) and the trend of SDR (on the y axis) for different number of consumers (on the x axis) and different number of merchants (one curve for each possible number of merchants). We can notice that SDR monotonically decreases as the number of consumers gets larger. This is reasonable because, according to the specification of the channel used by the connector, larger number of consumers leads to higher message loss. The same applies when comparing the curves with different number of merchants: if we fix the number of consumers, SDR is lower when the connected system contains a larger number of merchants. This is due to the fact that the connector must wait for the responses from all merchants before replying to the consumer, and the probability that at least one response gets lost increases when the system contains a larger number of merchants.

Evaluation of Results:

The guarantee (SDR ≥ 0.7) is not satisfied for the admissible range of consumers and merchants. The Evaluator, hence, reports a warning message to Synthesis. In the following, we consider the case in which Synthesis replies with a combined improvement request with a new deployment type and a dependability mechanism, which requires the evaluation of both improvements. The specification associated with the new deployment reports that the failure mode on the consumers' channel is still linked to the number of devices that use the channel through an exponential relation, but that the omission probability results in the range [0.81, 0.96]. The first improvement to be evaluated is a new deployment type.

Dependability Enhancement: The analysis results for the alternative deployment are shown in Figure 6(b). The guarantee is still not met for connected systems with high number of consumers and merchants.

The Evaluator, hence, triggers a sensitivity analysis for the possible failure modes. The impact of each failure mode is evaluated separately. The results of the analysis when considering only the omission failure on the consumers' channel are shown in Figure 7(a); the results when considering only the omission failure on the merchants' channel are shown in Figure 7(b). The Evaluator gives the highest rank to the failure mode on the consumers' channel because the number of times the guarantee is dissatisfied is higher when the failure on the consumers' channel is enabled.

The Enhancer, according to the considered ontology of dependability mechanisms, chooses a message retransmission technique to contrast the omission failures. We assume that the ontology reports that the maximum allowed number of retransmissions is 2. Figure 8(a) shows the analysis results for a connected system when the connector is enhanced with message retransmissions. The figure reports the value of SDR in the case of 5 merchants, which is the most critical scenario. In the figure, R c (R m ) represent the number of retransmissions performed on the consumers' (merchants') channel. The Enhancer tries to apply first the retransmission mechanism to the transitions performed on the consumers' channel. Nevertheless, the guarantee is not satisfied even when the maximum allowed number of retransmissions is used. Hence, the Enhancer applies the retransmission technique also to the transitions performed on the merchants' channel. Although SDR gets further improved, the guarantee is still not satisfied when the connected system contains high number of merchants.

The Evaluator, then, triggers an analysis of the connected system in the case of combined use of the two improvements. Figure 8(b) shows the analysis results for a connected system with 5 merchants (the most critical scenario): the first combination found by the Evaluator that allows to satisfy the guarantee is the alternative connector deployment with two retransmissions on the consumers' channel (R c = 2) and one retransmission on the merchants' channel (R m = 1). This information is reported to Synthesis in order to enable the deployment of an enhanced connector that satisfies the given dependability requirements.

V. DISCUSSION AND RELATED WORK

The architectural structure and implementation described in this paper constitute an important step towards the definition of an automated procedure to provide dependability analysis as a support for the synthesis of dependable connectors. There are various aspects that still need to be investigated to fully reach the ambitious goal of automated dependability analysis, including (i) how to optimise the analysis in order to respect given time constraints, (ii) compositional solution methods for the dependability model when the synthesised connector is derived as specialisation of an already analysed connector, (iii) the definition of an ontology to support the identification of dependability mechanisms suitable to enhance the dependability level of the synthesised connector.

Research on the definition of transformation-based verification and validation environments are being pursued since several years. Providing automatic/automated transformations methods from system specification languages to modelling languages amenable to perform dependability analysis has been recognised as an important support for improving the quality of systems. In addition, it favours the application of verification and validation techniques at industry level, where these methods are not widely used primarily due to the high level of abstractness of the mathematical modelling and analysis techniques. To provide some examples of related work on automated dependability analysis, in [START_REF] Csertan | VIATRA -Visual Automated Transformations for Formal Verification and Validation of UML Models[END_REF], the Viatra tool is presented, which allows to automatically check consistency, completeness, and dependability requirements of systems designed using the Unified Modelling Language; in [START_REF] Calinescu | Using quantitative analysis to implement autonomic IT systems[END_REF], an autonomic architecture is shown that uses Markov-chain quantitative analysis to dynamically adjust the parameters of an IT system.

VI. CONCLUSIONS

This paper has presented an approach for the realisation of a completely automated dependability analysis in heterogeneous and dynamic environments. The presented research activity is undertaken in the context of the framework proposed in the European project CONNECT, which is general and well suited for addressing interoperability in the context of complex pervasive systems. A modelbased approach has been adopted, which can be successfully employed since the early stages of the connector synthesis. The logical architecture of a Dependability unit that supports the synthesis of dependable connectors has been presented together with a prototype implementation. A simple case study has been considered to show how the approach works and the utility of the Dependability unit in guiding the connector synthesis.

Figure 1 .

 1 Figure 1. Input-Output relations of the Dependability unit.

Figure 2 .

 2 Figure 2. Architecture of the Dependability unit.

Function

  Description timeF rame(s) : S → R + returns the interval of time when the system is in state s minT imeStamp(tr) : T → R + returns the first instant of time when transition tr fires avgT imeStamp(tr) : T → R + returns the average instant of time when transition tr fires maxT imeStamp(tr) : T → R + returns the last instant of time when transition tr fires #(tr, t1, t2) : T × R + × R + → N returns the number of times transition tr fires during the time frame [t1, t2] #(l, t1, t2) : L × R + × R + → N returns the number of times transitions with label l fire during the time frame [t1, t2]

  (a) Basic model. (b) Enhanced model.

Figure 3 .

 3 Figure 3. Example of dependability mechanism and application rule.

  Figure 4. LTS specifications.

  (a) LTS model of the connected system. (b) SAN model of the connected system.

Figure 5 .

 5 Figure 5. Connected system models with one consumer, one connector and two merchants.

  (b) we show the SAN model obtained from such LTS. Reward Model: The syntax tree of the SDR metric expression has two branches: the quotient operator is the root of the tree, and the dividend and divisor are the two branches of the tree. The functions of the two branches are translated into impulse reward functions associated to the timed activities tpBuyResp, and tpListBrowse. Each reward function returns 1 every time the associated transition fires. The impulse rewards are evaluated during the time frame [0, 200], as specified in the guarantee.

  (a) Synthesised connector. (b) Alternative deployment.

Figure 6 .

 6 Figure 6. Metric assessment.

Figure 7 .

 7 Figure 7. Sensitivity analysis.

  (a) Original deployment with retransmissions. (b) Alternative deployment with retransmissions.

Figure 8 .

 8 Figure 8. Metric assessment when using dependability mechanisms.

Table I EXAMPLES

 I OF PREDEFINED FUNCTIONS THAT CAN BE USED IN THE METRIC EXPRESSION.

ACKNOWLEDGEMENTS

This work is partially supported by the EU FP7 Project CONNECT (FP7-231167).


Vicenta Escribà-Agüir

Lucía Artazcoz

Gender differences in postpartum depression. A longitudinal cohort study

Keywords: depressive disorder, pregnancy, gender, mothers, fathers, risk factors

Background:

The course of depression from pregnancy to one year postpartum and their risk factors among mothers and fathers are not known. This study has two aims: 1) To report the longitudinal patterns of depression from third trimester of pregnancy to one year after childbirth and 2) to determine gender differences between women and their partners in the effect of psychosocial and personal factors on postpartum depression.

Methods

: A longitudinal cohort study was carried out over a consecutive sample of 769 women in their third trimester of pregnancy and their partners attending the prenatal program in the Valencian Community (Spain) and follow up at 3 and 12 months postpartum. The outcome variable was the presence of depression at 3 or 12 months postpartum measured by the Edinburgh Postnatal Depression Scale. Predictor variables were: psychosocial (marital dissatisfaction, confidant and affective social support) and personal variables (previous history of depression, partner's depression and negative life events, depression during third trimester of pregnancy). Logistic regression models have been fitted via generalised estimating equations. Results: At 3 and 12 months postpartum, 9.3% and 4.4% of mothers and 3.4% and 4.0% of fathers, respectively, were new cases of depression. Low marital satisfaction, partner's depression and depression during pregnancy increased the probability of depression during 12 months postpartum in mothers and fathers. Negative life events increased the risk of depression only among mothers. Conclusions: Psychosocial and personal factors were strong predictors of depression during 12 months postpartum both for mothers and fathers.

INTRODUCTION

Women, especially women of childbearing age, are at high risk of depression.

Evidence suggests that postpartum depression can be part of a continuum, with onset of illness during pregnancy. [START_REF] Ryan | Depression during pregnancy[END_REF] However, the course of depression during the first year postpartum and risk factors are not known, mainly because most research has only assessed depression on one single occasion, and only took into account a follow-up period covering the first months postpartum. [START_REF] Verker | Prediction of depression in the postpartum period: a longitudinal follow-up study in high-risk and low-risk women[END_REF] Moreover, more attention has been paid to the problem of postpartum depression among women, but paternal postpartum depression is a relatively unrecognised phenomenon. [START_REF] Goodman | Paternal postpartum depression, its relationship to maternal postpartum depression, and implications for family health[END_REF] Recent studies that examine symptoms of women's depression across the transition from pregnancy to the postpartum period show a considerable stability in the incidence of depression, despite a decrease in symptoms from pregnancy to postpartum. [START_REF] Heron | The course of anxiety and depression through pregnancy and the postpartum in a community sample[END_REF][START_REF] Evans | Cohort study of depressed mood during pregnancy and after childbirth[END_REF] Nevertheless, these rates vary across studies depending upon factors such as time of assessment, definition of depression, instrument used to measure depression and the cultural characteristics of the populations studied. [START_REF] Matthey | Paternal and maternal depressed mood during the transition to parenthood[END_REF][START_REF] Halbreich | Cross-cultural and social diversity of prevalence of postpartum depression and depressive symptoms[END_REF] The scientific literature has highlighted the influence of personal and psychosocial risk factors (past history of depression, stressful life events, low social support, marital problems) during pregnancy on postpartum depression. [START_REF] Goodman | Paternal postpartum depression, its relationship to maternal postpartum depression, and implications for family health[END_REF][START_REF] Rubertsson | Depressive mood in early pregnancy and postpartum: prevalence and women at risk in a national Swedish sample[END_REF][START_REF] Robertson | Antenatal risk factors for postpartum depression: a synthesis of recent literature[END_REF][START_REF] O'hara | Rates and risk of postpartum depression-a metaanalysis[END_REF][START_REF] Nielsen | Postpartum depression: identification of women at risk[END_REF][START_REF] Areias | Correlates of postnatal depression in mothers and fathers[END_REF][START_REF] Tambs | Depression during pregnancy and after delivery: A repeated measurement study[END_REF][START_REF] Boyce | Psychosocial risk factors to major depression after childbirth[END_REF] Nevertheless, most studies have used a cross-sectional design. Additionally, only a limited number of studies have addressed the study of fathers' depression risk factors during pregnancy and postnatal period, but a recent meta-analysis showed that maternal depression was a strong predictor of postpartum depression among fathers. [START_REF] Goodman | Paternal postpartum depression, its relationship to maternal postpartum depression, and implications for family health[END_REF] Despite the existence of several studies which assess the evolution of the incidence of depression among mothers along the first year of life of their last born child and their risk factors, few studies include large samples of mothers and fathers with the aim of identifying gender differences, if any, in the pattern of depression and risk factors during the first year after childbirth. Therefore, this study has two aims: a) to report the longitudinal patterns of depression incidence from third trimester of pregnancy to one year after childbirth and b) to determine gender differences between women and their partners in the effect of psychosocial (marital dissatisfaction, social support) and personal factors (previous history of depression, negative life events, pregnancy depression and partner's depression) on depression during the first year postpartum.

METHODS

Study design and setting

A longitudinal cohort study was carried out over a consecutive sample of 769 women in their third trimester of pregnancy, between 28 and 31 weeks of pregnancy (phase I), and their partners attending the prenatal program in 10 primary care centres of the Valencian Community (Spain). In Spain, provided the characteristics of the health system (universal and free), and more precisely in the Valencian Community, almost 80% of pregnant women are assisted by primary healthcare midwives, within the prenatal program. Only pregnancies with high obstetric risk are lost, since these cases are under hospital follow-up protocol. The socio-demographic profile of these women is similar to the profile of other women in the same reproductive age, the only difference being 2% more of foreign women. Verbal informed consent was obtained from each participant, with a letter explaining the purposes of the study. Response rates were 89.34% for women and 87% for men, providing a sample of 687 and 669 subjects, respectively.

After initial participation at phase I, a postal questionnaire was sent at 3 months postpartum (phase II) and another one at 12 months postpartum (phase III). The participation rate at these two phases was 74.9% and 75.9% (phase II) and 69.7% and 70.6% (phase III) for mothers and fathers, respectively. 420 (61.13%) women and 409 (61.14%) men were participants at all three phases.

Outcome variable

Depression at phase I, II and III was assessed by means of the validated Spanish version of the Edinburgh Postnatal Depression Scale (EPDS), using a threshold score of 12/13. [START_REF] Garcia Esteve | Validation of the Edinburgh Postnatal Depression Scale (EPDS) in Spanish mothers[END_REF] This validation has not determined the cut-off score for fathers so as Matthey et al [START_REF] Matthey | Validation of the Edinburgh Postnatal Depression Scale for men, and comparison of item endorsement with their partners[END_REF] suggested, a two-point lower cut-off score (>=11) was used. The outcome variable was the presence of depression either at phase II or III.

Predictor variables

Psychosocial variables

Two variables were analysed (marital satisfaction and social support). They were measured at phase I and II. Marital satisfaction was measured with the ENRICH Marital Satisfaction Scale (10 items) [START_REF] Fowers | ENRICH Marital Satisfaction Scale: A Brief and Clinical Tool[END_REF] adapted to Spanish cultural context (translation and back-translation). Each item was rated on a 4-point scale. The internal consistency of this scale was of 0.93. The total score was categorized into high (>24 for women, >25 for men) and low (≤24 for women, ≤25 for men) from the values obtained in a k-means clustering technique, using squared Euclidean distance.

Duke-UNC functional social support questionnaire (11 items) validated for Spain [START_REF] Saameño | Validez y fiabilidad del cuestionario de apoyo social funcional Duke-UNC-11[END_REF][START_REF] Broadhead | The Duke-UNC Functional Social Support Questionnaire. Measurement of social support in family medicine patients[END_REF] was used to measure functional elements of social support. This 11-item questionnaire has two subscales: a) affective social support (4 items) to measure positive affective expressions; b) confidant social support (7 items), including social functions such as a confidant relationship. Each item was rated on a 5-category Likertformat. The internal consistency of these two subscales were 0.79 and 0.88, respectively. Both subscales were dichotomised into high and low, taking 15 percentile as cut-point.

Personal variables

Previous history of depression (measured at phase I), partner's depression (measured at phase I and II) and negative life events (measured at phase I and II) were included. Previous history of depression was measured with a question about the presence of depression during 12 months before pregnancy. The indicator presence or absence of unfavourable life events was elaborated using 5 questions (serious illness or death of a close family member, serious illness or death of a close friend, separation or divorce, partner's loss of job, and serious economical problems), considering that someone presented unfavourable life events if at least one of the events mentioned above was present. Depression during third trimester of pregnancy (28-31 weeks of pregnancy) was also included.

Time data collection

We introduce time of data collection (3 and 12 month of postpartum) as a potential predictor variable.

Adjusting variables

Some previous studies have shown a relationship between postpartum depression and several personal, socio-professional factors (age, employment during pregnancy, couple's occupational social class, parity, native country, weekly hours devoted to domestic chores). [START_REF] Robertson | Antenatal risk factors for postpartum depression: a synthesis of recent literature[END_REF][START_REF] Nielsen | Postpartum depression: identification of women at risk[END_REF][START_REF] Kleinman | Sociodemographic predictors of antenatal and postpartum depressive symptoms among women in a medical group practice[END_REF][START_REF] Tammentie | Sociodemographic factors of families related to postnatal depressive symptoms of mothers[END_REF][START_REF] Haas | Changes in the health status of women during and after pregnancy[END_REF][START_REF] Bolton | Incidence and demographic correlates of depressive symptoms during pregnancy in an inner London population[END_REF][START_REF] Escribà-Agüir | Psychological distress of new Spanish mothers[END_REF][START_REF] Artazcoz | Gender inequalities in health among workers: the relation with family demands[END_REF] Therefore, we included these variables as adjusting factors. Weekly hours devoted to domestic chores were measured at phase I and II. Couples' occupational social class was assigned according to the occupation of the woman or their couple (whichever was higher) and was coded with a widely used Spanish adaptation of the British classification. [START_REF]Proposal for a social class measure: Working Group of the Spanish Society Epidemiology and the Spanish Society of Family and Community Medicine[END_REF] Robertson et al [START_REF] Robertson | Antenatal risk factors for postpartum depression: a synthesis of recent literature[END_REF], in a systematic evidence-based literature review about risk factors of postpartum depression, showed that obstetric factors, including pregnancy-related complications such as preeclamsia, hyperemesis, premature labour, as well as delivery-related complications, such as caesarean section and instrumental delivery, have a small effect on the development of postpartum depression. In our study these variables have not been adjusted, since they did not have any significant association with the outcome variable.

Statistical analysis

Logistic regression analyses were used to examine the longitudinal relation between psychosocial and personal factors and subsequent postpartum depression. Specifically, we used generalized estimating equation (GEE) approach for analysing correlated data. In addition, GEE accommodates both time dependent (marital satisfaction, affective and confidant social support, partner's depression, negative life events and weekly hours devoted to domestic chores) and time independent covariates (previous history of depression, employment during pregnancy, couple's occupational social class, parity, native country). Mothers and fathers who are depressed at third trimester of pregnancy may have reported psychosocial factors in a negative way.

Therefore, two models were fitted excluding and including depression during the third trimester of pregnancy as an explanatory variable. Subjects with complete data at all three phases were included in analyses. Analyses were conducted using Stata software (Stata Corp, College Station, Texas, USA).

RESULTS

Description of the sample

The distribution of depression during the third trimester of pregnancy and the psychosocial and personal characteristics of the sample are shown in table 1. The prevalence of depression during pregnancy was higher among females (10.3%) than among males (6.5%). Among men whose partners were experiencing pregnancy depression, the prevalence of pregnancy depression was 14.5% and conversely 23.3% of mothers experienced depression during pregnancy when their partners did. The percentage of couples where at least one parent experienced depression during pregnancy was 15.1%. Prevalence of psychosocial factors was similar for both sexes.

The prevalence of previous history of depression was lower among men (9.8% versus 21.4%). Concerning socio-professional factors, percentages were also similar except for age, employment status and domestic chores. Fathers were older and spent less time doing housework.

(Insert table 1)

Longitudinal patterns of depression from 28 and 31 weeks of pregnancy to 12 months postpartum

Figure 1 shows several notable features of depression from 28 and 31 weeks of pregnancy to 12 months postpartum. First, most of mothers and fathers (77.9% and 87.8%, respectively) reported no elevated depression during this period. Second, the layout of the figure also makes possible a calculation of the percentage of women who were new cases of depression in postnatal period. Numbers within the round shapes below the birth line indicate postnatal depression. At 3 months postpartum, 9.3% of mothers and 3.4% of fathers were new cases of depression. These percentages were 4.4% for mothers and 4.0% for fathers at 12 months postpartum. A decrease in the incidence of depression during the last 12 months postpartum was found among mothers (9.3% versus 4.4%) but the association is within the limit of statistical significance (p=0.074, table 2). However, these incidences remain constant among fathers (3.4% versus 4.0%, p=0.369, table 2).

(Insert figure 1)

Multivariate results

Table 2 shows the incidence of depression at 3 or 12 months postpartum according to psychosocial and personal factors and multivariate results. The incidence of depression during 12 months postpartum was higher among mothers and fathers with low marital satisfaction (14.7% and 8.8%, respectively), low affective social support (17.8% and 10.3%, respectively), low confidant social support (22.5% and 10.9%, respectively), and with pregnancy depression (32.7% and 33.3%, respectively). Also, this incidence was higher when partner was depressed in either sex (27.8% in mothers and 16.3% in fathers). The incidence of depression during 12 months postpartum was higher among mothers with previous history of depression and negative life events, whereas among fathers these associations were not statistically significant.

Results obtained with the two models fitted were very similar for mothers and fathers. Low marital satisfaction, partner's depression and depression during pregnancy increased the probability of depression during 12 months postpartum in either sex. Prior history of depression did not associate with depression during 12 months postpartum among mothers and fathers. Negative life events increased the risk of depression during 12 months postpartum only among mothers. Lack of affective and confidant social support did not increase the risk of depression during 12 months postpartum for both mothers and fathers. Nevertheless, if our results were statistically significant, genderbased differences would be taken into account when determining the impact of social support on depression. Provided that, among men, low affective social support would be a risk factor of depression during 12 months postpartum whereas among women it would be the case of low confidant support. The probability of postpartum depression was lower at 12 months postpartum in mothers although the association was at the limit of statistical significance (p=0.074). However, there was no evidence of association between time data collection and postpartum depression in fathers (p=0.369).

(Insert table 2)

DISCUSSION

To our knowledge, this is one of the largest longitudinal cohort studies of depression from third trimester of pregnancy to one year after childbirth that includes both mothers and fathers attending the prenatal program in primary care centres of the Valencian Community (Spain). This manuscript reports the longitudinal patterns of depression from the third trimester of pregnancy to one year after childbirth among mothers and fathers and presents both similarities and differences between them in the effect of psychosocial (marital satisfaction, social support) and personal factors (partner's depression, previous history of depression, negative life events and depression during the third trimester of pregnancy) on depression during one year after childbirth, measured by the EPDS, among a sample of mothers and their partners from Valencia (Spain). This study has produced three main findings: 1) the incidence of depression was higher among mothers at 3 months of postpartum, but was similar at 12 months postpartum among mothers and fathers, 2) the incidence of depression decreased during the first postpartum year for mothers but the association is within the limit of statistical significance, 3) although most psychosocial and personal factors associated with depression one year after childbirth were similar for both sexes (marital satisfaction, partner's depression, pregnancy depression), negative life events was only related to women's depression. Lack of affective and confidant social support did not increase the risk of depression either in men or women.

The incidence of depression at 3 and 12 month postpartum for mothers was similar to the one reported by other authors who have used the same cut-off score and scale of measurement. [START_REF] Heron | The course of anxiety and depression through pregnancy and the postpartum in a community sample[END_REF][START_REF] Evans | Cohort study of depressed mood during pregnancy and after childbirth[END_REF] Also the incidence of fathers' depression during the first postpartum year was similar to the one showed in the literature. Depression rates in community-based samples of fathers during one year after childbirth ranges from low 1.2% to high 25.5%. [START_REF] Goodman | Paternal postpartum depression, its relationship to maternal postpartum depression, and implications for family health[END_REF] Consistently with literature, [START_REF] Heron | The course of anxiety and depression through pregnancy and the postpartum in a community sample[END_REF][START_REF] Evans | Cohort study of depressed mood during pregnancy and after childbirth[END_REF] most women reported no elevated depression (78%) during one year after childbirth. As other authors have stated, the incidence of depression at 3 months postpartum was higher among mothers than among fathers [START_REF] Matthey | Paternal and maternal depressed mood during the transition to parenthood[END_REF][START_REF] Areias | Correlates of postnatal depression in mothers and fathers[END_REF][START_REF] Escribà-Agüir | Factors related to depression during pregnancy: are there gender differences?[END_REF][START_REF] Ramchandani | Paternal depression in the postnatal period and child development: a prospective population study[END_REF][START_REF] Perren | Depressive symptoms and psychosocial stress across the transition to parenthood: Associations with parental psychopathology and child difficulty[END_REF][START_REF] Ballard | Prevalence of postnatal psychiatric morbidity in mothers and fathers[END_REF] but, surprisingly, the incidence was similar for mothers and fathers at one year after childbirth. As other recent follow-up studies, in our study there was a little decrease in the incidence of depression from 3 months postpartum to one year after childbirth among women [START_REF] Heron | The course of anxiety and depression through pregnancy and the postpartum in a community sample[END_REF][START_REF] Evans | Cohort study of depressed mood during pregnancy and after childbirth[END_REF][START_REF] Tambs | Depression during pregnancy and after delivery: A repeated measurement study[END_REF] but the association is within the limit of statistical significance. Goodman [START_REF] Goodman | Paternal postpartum depression, its relationship to maternal postpartum depression, and implications for family health[END_REF] pointed out that, unlike mothers, for whom the onset of postpartum depression is usually in the early postpartum period, there is some evidence that depression among men begins later, often following the onset of depression in women, with the rate among fathers increasing over the first year. In this study there is no evidence of a significant increase of depression one year after childbirth among men, maybe due to the scarce number of cases detected at time of measurement (13 and 15 cases at 3 and 12 months postpartum, respectively).

Similarly to others authors, a strong association was identified between poor marital relationships and depression during the first postpartum year in both sexes and the magnitude of the odds ratio was similar. [START_REF] Robertson | Antenatal risk factors for postpartum depression: a synthesis of recent literature[END_REF][START_REF] O'hara | Rates and risk of postpartum depression-a metaanalysis[END_REF][START_REF] Tambs | Depression during pregnancy and after delivery: A repeated measurement study[END_REF][START_REF] Boyce | Psychosocial risk factors to major depression after childbirth[END_REF][START_REF] Escribà-Agüir | Factors related to depression during pregnancy: are there gender differences?[END_REF][START_REF] Deater-Deckard | Family structure and depressive symptoms in men predicting and following the birth of a child[END_REF] Childbirth usually implies an additional burden of work for mothers and fathers and consequently, the relationship between partners often suffers, and reduces leisure time as well.

Contrary to other authors, [START_REF] Robertson | Antenatal risk factors for postpartum depression: a synthesis of recent literature[END_REF][START_REF] O'hara | Rates and risk of postpartum depression-a metaanalysis[END_REF][START_REF] Nielsen | Postpartum depression: identification of women at risk[END_REF][START_REF] Areias | Correlates of postnatal depression in mothers and fathers[END_REF][START_REF] Seguin | Depressive symptoms in the late postpartum among low socioeconomic status women[END_REF] lack of affective and confidant social support did not increase the risk of depression during 12 months postpartum for both mothers and fathers. Nevertheless, if our results were statistically significant, gender-based differences would be taken into account when determining the impact of social support on depression; provided that, among men low affective social support would be a risk factor of postpartum depression, and among women it would be low confidant support.

Probably, with a larger sample, statistically significant differences could be found.

Research on gender differences in styles of interpersonal relationship suggests that men are more dependent on their spouses for emotional support than on other network members. By contrast, women are more likely to seek out friends in order to share feelings and problems (confident social support), whereas male friendships focuses more on shared activities or "distractions". [START_REF] Richman | Gender roles, social support, and postpartum depressive symptomatology. The benefits of caring[END_REF] It has been reported that maternal postpartum depression is a strong predictor of postpartum depression for males. [START_REF] Goodman | Paternal postpartum depression, its relationship to maternal postpartum depression, and implications for family health[END_REF][START_REF] Escribà-Agüir | Factors related to depression during pregnancy: are there gender differences?[END_REF][START_REF] Ballard | Prevalence of postnatal psychiatric morbidity in mothers and fathers[END_REF][START_REF] Deater-Deckard | Family structure and depressive symptoms in men predicting and following the birth of a child[END_REF][START_REF] Bielawska-Batorowicz | Depressive mood in men after the birth of their offspring in relation to a partner's depression, social support, father's personality and prenatal expectations[END_REF]] Moreover, we have found the same association for mothers and the magnitude of the effect was similar for both mothers and fathers.

Several studies suggest that previous psychopathological history [START_REF] Robertson | Antenatal risk factors for postpartum depression: a synthesis of recent literature[END_REF][START_REF] Nielsen | Postpartum depression: identification of women at risk[END_REF][START_REF] Tambs | Depression during pregnancy and after delivery: A repeated measurement study[END_REF][START_REF] Boyce | Psychosocial risk factors to major depression after childbirth[END_REF] may be an important determinant of women depression after childbirth. In this study we used two indicators to evaluate previous psychopathology history (depression during pregnancy and history of depression 12 months before pregnancy). One of these indicators (depression during pregnancy) is a strong predictor of postpartum depression among mothers and fathers. [START_REF] Verker | Prediction of depression in the postpartum period: a longitudinal follow-up study in high-risk and low-risk women[END_REF][START_REF] Goodman | Paternal postpartum depression, its relationship to maternal postpartum depression, and implications for family health[END_REF][START_REF] Matthey | Paternal and maternal depressed mood during the transition to parenthood[END_REF][START_REF] Robertson | Antenatal risk factors for postpartum depression: a synthesis of recent literature[END_REF][START_REF] O'hara | Rates and risk of postpartum depression-a metaanalysis[END_REF][START_REF] Brockington | Postpartum psychiatric disorders[END_REF][START_REF] Beck | A meta-analysis of predictors of postpartum depression[END_REF] However, there was no evidence of association between history of depression 12 months before pregnancy and postpartum depression either for mothers or fathers. This could be explained because when introducing 2 variables to measure the same concept, the variable which plays a more important role as a predictor of depression after childbirth, is the one which refers to a more recent period of exposure (depression during pregnancy).

Our results were consistent with other studies in that women who suffer negative life events [START_REF] Robertson | Antenatal risk factors for postpartum depression: a synthesis of recent literature[END_REF][START_REF] O'hara | Rates and risk of postpartum depression-a metaanalysis[END_REF][START_REF] Tambs | Depression during pregnancy and after delivery: A repeated measurement study[END_REF][START_REF] Eskild | Depression in postpartum and non-postpartum women: prevalence and risk factors[END_REF] were at greater risk of developing depression during one year after childbirth.

Limitations

The longitudinal nature of the analysis and the adjustment for baseline depression to adjust the effect of mood on reporting psychosocial factors reduces the limitations of these data. There were some slight statistical differences in socio-professional characteristics (age, native country, employment status, education) between respondents and non-respondents. However, mothers and fathers who did not respond for phase II and III did not have higher scores in the prevalence of depression during the third trimester of pregnancy. The prevalence of mothers' depression during the third trimester of pregnancy was 9.1% versus 10.8% among respondents and non-respondents at phase II. These percentages were 9.6% and 10.7% at phase III. Among fathers these percentages were 7.0% for respondents and 5.1% for non-respondents at phase II and 7.3% and 4.8%, respectively at phase III. Therefore, our results cannot be biased by selective-non response.

Implications for practice and research

Depression during pregnancy and postpartum is a serious mental health problem for both mothers and fathers and its consequences have serious implications for the welfare of the family and the psychological development of the child. [START_REF] O'hara | Rates and risk of postpartum depression-a metaanalysis[END_REF] When one parent is depressed, the child's environment is compromised and the child is at risk to adverse outcomes (behavioural problems, poor cognitive development, etc.). Moreover, it should be taken into account that risk of depression among parents increases with partner's depression and that when both parents are depressed, the risk for the child increases. Also, health professionals should be aware of potentially vulnerable groups (couples with marital dissatisfaction or women with negative life events) to provide effective interventions (e.g. to provide intensive professionally-based postpartum support, telephone peer -mother to mother-support). [START_REF] Dennis | Psychosocial and psychological interventions for prevention of postnatal depression: systematic review[END_REF], [START_REF] Dennis | Effect of peer support on prevention of postnatal depression among high risk women: multisite randomised controlled trial[END_REF] In conclusion, these findings suggest that among longitudinal data, using time vary measures, psychosocial (marital satisfaction) and personal factors (partner's depression, depression during the third trimester of pregnancy) were strong predictors of depression one year after childbirth for both mothers and fathers. A possible genderdifferent impact of affective and confidant social support on depression one year after childbirth was observed. Therefore, longitudinal research among non-selected population is needed to explain these possible gender differences.

WHAT IS ALREADY KNOW ON THIS SUBJECT

Despite the existence of several studies which assess the evolution of the incidence of depression among mothers along the first year of life of their last born child and their risk factors, few researches include large samples of mothers and fathers with the aim of identifying gender differences in the pattern of depression during the first year after childbirth and their risk factors.

WHAT THIS STUDY ADDS

With respect to longitudinal patterns of depression from the third trimester of pregnancy to one year after childbirth among mothers and fathers, we found two main findings: 1) the incidence of depression was higher among mothers at 3 months postpartum but was similar at 12 months postpartum among mothers and fathers and 2) the incidence of depression decreased during the first postpartum year only in mothers, but the association is within the limit of statistical significance.

A strong predictor of postnatal depression both for mothers and fathers is depression during pregnancy.

Most psychosocial and personal factors associated with depression one year after childbirth were similar for both sexes (marital satisfaction, partner's depression, pregnancy depression).

FATHERS

Figure 1. Flow chart of depression (EPDS) across the three occasions of measurement. At each row (i.e. occasion of measurement), the sample was divided between those who scores above the cut-off for depression (round) and those who did not score above the cut-off for depression (square). The two entries in each cell in this figure represent, respectively, the number of mothers/fathers in each cell and the percent with respect row above.

Table 1 .

 1 Depression, psychosocial characteristics measured at third trimester of pregnancy and personal characteristics of the sample Cut off value was ≥ 13 for mothers and ≥11 for fathers2 To have a paid work during pregnancy in mothers and in fathers at the moment of data collection

	Mothers		Fathers
	n	%	n	%	p-value

Funding: Study partially financed by three research grants from "Fondo de Investigaciones Sanitarias" (Ministry of Health): PI050443, Gender and Health Network (G03/42) and Epidemiology and Public Health CIBER (CIBERESP) and two from "Conselleria de Sanitat. Generalitat Valenciana" (PI-031/2004 y PI-59/2005).

Competing Interest: None declared

Contributors

Vicenta Escribà-Agüir, designed the study, oversaw the executions of the study, analysed the resulting data and wrote the article. Lucia Artazcoz assisted interpreting findings and contributed to the analysis plan and editing of the article.